diff --git a/Makefile.am b/Makefile.am index 36cc1e30..04280af5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ if BUILD_WINCOMPAT -SUBDIRS = libev src +SUBDIRS = libcork libipset libev src else -SUBDIRS = libasyncns libev src +SUBDIRS = libcork libipset libasyncns libev src endif ACLOCAL_AMFLAGS = -I m4 man_MANS = shadowsocks.8 diff --git a/Makefile.in b/Makefile.in index 266a1e0e..73e9d8e4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,23 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -51,10 +78,10 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . -DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure COPYING INSTALL ar-lib compile \ - config.guess config.sub depcomp install-sh ltmain.sh missing +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in COPYING INSTALL ar-lib compile \ + config.guess config.sub depcomp install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -70,15 +97,28 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -117,12 +157,34 @@ NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = libasyncns libev src +CSCOPE = cscope +DIST_SUBDIRS = libcork libipset libasyncns libev src DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -132,6 +194,7 @@ am__remove_distdir = \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -159,12 +222,14 @@ am__relativize = \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best +DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -281,8 +346,8 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@BUILD_WINCOMPAT_FALSE@SUBDIRS = libasyncns libev src -@BUILD_WINCOMPAT_TRUE@SUBDIRS = libev src +@BUILD_WINCOMPAT_FALSE@SUBDIRS = libcork libipset libasyncns libev src +@BUILD_WINCOMPAT_TRUE@SUBDIRS = libcork libipset libev src ACLOCAL_AMFLAGS = -I m4 man_MANS = shadowsocks.8 all: config.h @@ -325,8 +390,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -392,22 +457,25 @@ uninstall-man8: dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -422,57 +490,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -488,12 +511,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -505,15 +523,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -522,24 +536,33 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -605,40 +628,42 @@ distdir: $(DISTFILES) || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -649,8 +674,6 @@ distcheck: dist GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -662,18 +685,19 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod u+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -696,7 +720,7 @@ distcheck: dist && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -836,25 +860,24 @@ uninstall-am: uninstall-man uninstall-man: uninstall-man8 -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) all install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-man8 install-pdf install-pdf-am install-ps \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-man8 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-man uninstall-man8 + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-man uninstall-man8 # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/aclocal.m4 b/aclocal.m4 index 153869f1..2bbd150a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.6 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,33 +11,31 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.6], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,19 +51,17 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.6])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011 Free Software Foundation, Inc. +# Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper @@ -81,7 +76,8 @@ AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [am_cv_ar_interface=ar + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) @@ -98,7 +94,7 @@ AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], fi rm -f conftest.lib libconftest.a ]) - ]) + AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) @@ -122,17 +118,15 @@ AC_SUBST([AR])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -151,7 +145,7 @@ AC_SUBST([AR])dnl # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -177,22 +171,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -211,16 +202,14 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -230,7 +219,7 @@ fi])]) # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -243,12 +232,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -256,8 +246,8 @@ AC_CACHE_CHECK([dependency style of $depcc], # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -297,16 +287,16 @@ AC_CACHE_CHECK([dependency style of $depcc], : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -315,8 +305,8 @@ AC_CACHE_CHECK([dependency style of $depcc], test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -324,7 +314,7 @@ AC_CACHE_CHECK([dependency style of $depcc], fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -372,7 +362,7 @@ AM_CONDITIONAL([am__fastdep$1], [ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -382,9 +372,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -399,20 +393,18 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -425,7 +417,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -437,21 +429,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -469,7 +459,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -479,18 +469,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -503,7 +496,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -532,31 +525,40 @@ AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -567,34 +569,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -616,15 +662,12 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -638,16 +681,14 @@ if test x"${install_sh}" != xset; then install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -663,14 +704,12 @@ AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -688,7 +727,7 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -713,52 +752,14 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -766,11 +767,10 @@ AC_DEFUN([AM_MISSING_PROG], $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -783,54 +783,22 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -840,7 +808,7 @@ AC_DEFUN([_AM_MANGLE_OPTION], # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -854,24 +822,82 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -882,32 +908,40 @@ case `pwd` in esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -917,46 +951,118 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -970,18 +1076,16 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -991,76 +1095,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR diff --git a/ar-lib b/ar-lib index 0f62c6fc..fe2301e7 100755 --- a/ar-lib +++ b/ar-lib @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010, 2012 Free Software Foundation, Inc. +# Copyright (C) 2010-2013 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff --git a/compile b/compile index 862a14e8..531136b0 100755 --- a/compile +++ b/compile @@ -1,10 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-03-05.13; # UTC +scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free -# Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -113,6 +112,11 @@ func_cl_dashl () lib=$dir/$lib.lib break fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi done IFS=$save_IFS diff --git a/config.guess b/config.guess index d622a44e..9afd6762 100755 --- a/config.guess +++ b/config.guess @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2013-11-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ timestamp='2012-02-10' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -852,21 +874,21 @@ EOF exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -950,54 +967,63 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1227,19 +1256,31 @@ EOF exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1256,7 +1297,7 @@ EOF NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,9 +1371,6 @@ EOF exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c <. @@ -26,11 +20,12 @@ timestamp='2012-04-18' # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +116,7 @@ esac maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) @@ -156,7 +149,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -259,10 +252,12 @@ case $basic_machine in | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -270,10 +265,11 @@ case $basic_machine in | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -291,16 +287,17 @@ case $basic_machine in | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -328,7 +325,7 @@ case $basic_machine in c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -370,13 +367,13 @@ case $basic_machine in | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -385,11 +382,13 @@ case $basic_machine in | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -407,12 +406,13 @@ case $basic_machine in | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -788,11 +788,15 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -828,7 +832,7 @@ case $basic_machine in basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1019,7 +1023,11 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1346,21 +1354,21 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1492,9 +1500,6 @@ case $os in -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; @@ -1543,6 +1548,9 @@ case $basic_machine in c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; hexagon-*) os=-elf ;; @@ -1586,6 +1594,9 @@ case $basic_machine in mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff --git a/configure b/configure index 0156a394..5c986baa 100755 --- a/configure +++ b/configure @@ -693,6 +693,10 @@ CFLAGS CC ac_ct_AR AR +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -757,6 +761,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_dependency_tracking with_crypto_library enable_shared @@ -1403,8 +1408,12 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -2388,7 +2397,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" -am__api_version='1.11' +am__api_version='1.14' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2514,9 +2523,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2527,32 +2533,40 @@ case `pwd` in esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2564,6 +2578,16 @@ Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2586,12 +2610,12 @@ if test x"${MISSING+set}" != xset; then esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2603,10 +2627,10 @@ if test x"${install_sh}" != xset; then esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -2745,12 +2769,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2833,6 +2851,45 @@ else fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2883,18 +2940,70 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -2914,7 +3023,7 @@ am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -3747,6 +3856,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -3758,8 +3926,8 @@ else # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -3794,16 +3962,16 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -3812,8 +3980,8 @@ else test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -3821,7 +3989,7 @@ else fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -3983,7 +4151,13 @@ $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_ar_interface=ar + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; @@ -4014,6 +4188,11 @@ if ac_fn_c_try_compile "$LINENO"; then : fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 @@ -4591,6 +4770,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -4602,8 +4840,8 @@ else # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -4638,16 +4876,16 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -4656,8 +4894,8 @@ else test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -4665,7 +4903,7 @@ else fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -6006,6 +6244,10 @@ freebsd* | dragonfly*) fi ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -6044,11 +6286,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else @@ -8970,7 +9212,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -9448,9 +9690,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) - link_all_deplibs=no - ;; esac ld_shlibs=yes @@ -9672,7 +9911,7 @@ _LT_EOF fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -9849,7 +10088,6 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then @@ -10303,7 +10541,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } link_all_deplibs=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -11140,6 +11378,17 @@ freebsd* | dragonfly*) esac ;; +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -11256,7 +11505,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -11320,18 +11569,6 @@ fi dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -12345,131 +12582,6 @@ $as_echo "no" >&6; } fi -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi - fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi - @@ -14955,7 +15067,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_config_files="$ac_config_files Makefile libasyncns/Makefile libev/Makefile src/Makefile" +ac_config_files="$ac_config_files Makefile libcork/Makefile libipset/Makefile libasyncns/Makefile libev/Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -15066,6 +15178,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -15968,6 +16088,8 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libcork/Makefile") CONFIG_FILES="$CONFIG_FILES libcork/Makefile" ;; + "libipset/Makefile") CONFIG_FILES="$CONFIG_FILES libipset/Makefile" ;; "libasyncns/Makefile") CONFIG_FILES="$CONFIG_FILES libasyncns/Makefile" ;; "libev/Makefile") CONFIG_FILES="$CONFIG_FILES libev/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; @@ -16567,7 +16689,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -16580,7 +16702,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -16614,21 +16736,19 @@ $as_echo X"$mf" | continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || diff --git a/configure.ac b/configure.ac index 1cb363bf..833613e7 100755 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_INIT([shadowsocks], [1.4.5], [max.c.lv@gmail.com]) AC_CONFIG_SRCDIR([src/encrypt.c]) AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([foreign -Wall -Werror]) +AM_INIT_AUTOMAKE([subdir-objects foreign -Wall -Werror]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) dnl Checks for crypto library @@ -192,6 +192,8 @@ ACX_PTHREAD AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_FILES([Makefile + libcork/Makefile + libipset/Makefile libasyncns/Makefile libev/Makefile src/Makefile]) diff --git a/depcomp b/depcomp index 25a39e6c..4ebd5b3a 100755 --- a/depcomp +++ b/depcomp @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2012-03-27.16; # UTC +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,9 +27,9 @@ scriptversion=2012-03-27.16; # UTC case $1 in '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -57,11 +56,65 @@ EOF ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + # A tabulation character. tab=' ' # A newline character. nl=' ' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 @@ -75,6 +128,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -86,32 +142,32 @@ if test "$depmode" = hp; then fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 fi if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. - gccflag=-qmakedep=gcc,-MF - depmode=gcc + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -134,8 +190,7 @@ gcc3) done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -143,13 +198,17 @@ gcc3) ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -157,15 +216,14 @@ gcc) fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. @@ -174,15 +232,15 @@ gcc) ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -200,8 +258,7 @@ sgi) "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -209,7 +266,6 @@ sgi) if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in @@ -217,19 +273,15 @@ sgi) # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr "$nl" ' ' >> "$depfile" + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" - # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; @@ -247,9 +299,8 @@ aix) # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -262,9 +313,7 @@ aix) "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -273,65 +322,113 @@ aix) do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependent.h'. - # Do two passes, one to just change these to - # '$object: dependent.h' and one to simply 'dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" + aix_post_process_depfile ;; -icc) - # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. - # However on - # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\': - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - # tcc 0.9.26 (FIXME still under development at the moment of writing) - # will emit a similar output, but also prepend the continuation lines - # with horizontal tabulation characters. +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" - # Each line is of the form 'foo.o: dependent.h', - # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to - # '$object: dependent.h' and one to simply 'dependent.h:'. - sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ - < "$tmpdepfile" > "$depfile" - sed ' - s/[ '"$tab"'][ '"$tab"']*/ /g - s/^ *// - s/ *\\*$// - s/^[^:]*: *// - /^$/d - /:$/d - s/$/ :/ - ' < "$tmpdepfile" >> "$depfile" + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -342,9 +439,8 @@ hp2) # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -355,8 +451,7 @@ hp2) "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -366,76 +461,61 @@ hp2) test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; msvc7) if test "$libtool" = yes; then @@ -446,8 +526,7 @@ msvc7) "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -473,6 +552,7 @@ $ { G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; @@ -524,13 +604,14 @@ dashmstdout) # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' "$nl" < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -583,10 +664,12 @@ makedepend) # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -622,10 +705,10 @@ cpp) esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -657,15 +740,15 @@ msvisualcpp) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | diff --git a/install-sh b/install-sh index a9244eb0..377bb868 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-01-19.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ scriptversion=2011-01-19.21; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,7 +156,7 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -190,7 +190,7 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac @@ -202,7 +202,7 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi @@ -240,7 +240,7 @@ fi for src do - # Protect names problematic for `test' and other utilities. + # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac @@ -354,7 +354,7 @@ do if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in diff --git a/libasyncns/Makefile.in b/libasyncns/Makefile.in index 187eb093..d8a587bb 100644 --- a/libasyncns/Makefile.in +++ b/libasyncns/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -34,23 +33,51 @@ # . VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -70,7 +97,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libasyncns -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -89,22 +117,47 @@ am__DEPENDENCIES_1 = libasyncns_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libasyncns_la_OBJECTS = asyncns.lo libasyncns_la_OBJECTS = $(am_libasyncns_la_OBJECTS) -libasyncns_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libasyncns_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libasyncns_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libasyncns_la_SOURCES) DIST_SOURCES = $(libasyncns_la_SOURCES) am__can_run_installinfo = \ @@ -112,11 +165,29 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -276,14 +347,17 @@ $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libasyncns.la: $(libasyncns_la_OBJECTS) $(libasyncns_la_DEPENDENCIES) $(EXTRA_libasyncns_la_DEPENDENCIES) - $(libasyncns_la_LINK) $(libasyncns_la_OBJECTS) $(libasyncns_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libasyncns_la_LINK) $(libasyncns_la_OBJECTS) $(libasyncns_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -294,25 +368,28 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asyncns.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -320,26 +397,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -351,15 +417,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -368,6 +430,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -509,18 +586,19 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/libcork/Makefile b/libcork/Makefile new file mode 100644 index 00000000..d7da651b --- /dev/null +++ b/libcork/Makefile @@ -0,0 +1,939 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# libcork/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + + +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/shadowsocks +pkgincludedir = $(includedir)/shadowsocks +pkglibdir = $(libdir)/shadowsocks +pkglibexecdir = $(libexecdir)/shadowsocks +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-apple-darwin13.1.0 +host_triplet = x86_64-apple-darwin13.1.0 +subdir = libcork +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ + $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libcork_la_LIBADD = +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_1 = cli/libcork_la-commands.lo +am__objects_2 = core/libcork_la-allocator.lo core/libcork_la-error.lo \ + core/libcork_la-gc.lo core/libcork_la-hash.lo \ + core/libcork_la-ip-address.lo core/libcork_la-mempool.lo \ + core/libcork_la-timestamp.lo core/libcork_la-u128.lo +am__objects_3 = ds/libcork_la-array.lo ds/libcork_la-bitset.lo \ + ds/libcork_la-buffer.lo ds/libcork_la-dllist.lo \ + ds/libcork_la-file-stream.lo ds/libcork_la-hash-table.lo \ + ds/libcork_la-managed-buffer.lo ds/libcork_la-ring-buffer.lo \ + ds/libcork_la-slice.lo +am__objects_4 = posix/libcork_la-directory-walker.lo \ + posix/libcork_la-env.lo posix/libcork_la-exec.lo \ + posix/libcork_la-files.lo posix/libcork_la-process.lo \ + posix/libcork_la-subprocess.lo +am__objects_5 = pthreads/libcork_la-thread.lo +am_libcork_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) +libcork_la_OBJECTS = $(am_libcork_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +libcork_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcork_la_CFLAGS) \ + $(CFLAGS) $(libcork_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libcork_la_SOURCES) +DIST_SOURCES = $(libcork_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing aclocal-1.14 +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AR = ar +AUTOCONF = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing autoconf +AUTOHEADER = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing autoheader +AUTOMAKE = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing automake-1.14 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = false +DSYMUTIL = dsymutil +DUMPBIN = +ECHO_C = \c +ECHO_N = +ECHO_T = +EGREP = /usr/bin/grep -E +EXEEXT = +FGREP = /usr/bin/grep -F +GREP = /usr/bin/grep +INET_NTOP_LIB = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /Library/Developer/CommandLineTools/usr/bin/ld +LDFLAGS = +LIBOBJS = +LIBS = -lcrypto +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = lipo +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing makeinfo +MANIFEST_TOOL = : +MKDIR_P = /usr/local/bin/gmkdir -p +NM = /usr/bin/nm +NMEDIT = nmedit +OBJDUMP = false +OBJEXT = o +OTOOL = otool +OTOOL64 = : +PACKAGE = shadowsocks +PACKAGE_BUGREPORT = max.c.lv@gmail.com +PACKAGE_NAME = shadowsocks +PACKAGE_STRING = shadowsocks 1.4.5 +PACKAGE_TARNAME = shadowsocks +PACKAGE_URL = +PACKAGE_VERSION = 1.4.5 +PATH_SEPARATOR = : +PTHREAD_CC = gcc +PTHREAD_CFLAGS = -D_THREAD_SAFE +PTHREAD_LIBS = +RANLIB = ranlib +SED = /usr/local/bin/gsed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 1.4.5 +abs_builddir = /Users/max/Develop/workspace/shadowsocks-libev/libcork +abs_srcdir = /Users/max/Develop/workspace/shadowsocks-libev/libcork +abs_top_builddir = /Users/max/Develop/workspace/shadowsocks-libev +abs_top_srcdir = /Users/max/Develop/workspace/shadowsocks-libev +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +acx_pthread_config = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-apple-darwin13.1.0 +build_alias = +build_cpu = x86_64 +build_os = darwin13.1.0 +build_vendor = apple +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-apple-darwin13.1.0 +host_alias = +host_cpu = x86_64 +host_os = darwin13.1.0 +host_vendor = apple +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +noinst_LTLIBRARIES = libcork.la +cli_src = cli/commands.c +core_src = core/allocator.c core/error.c core/gc.c \ + core/hash.c core/ip-address.c core/mempool.c \ + core/timestamp.c core/u128.c + +ds_src = ds/array.c ds/bitset.c ds/buffer.c ds/dllist.c \ + ds/file-stream.c ds/hash-table.c ds/managed-buffer.c \ + ds/ring-buffer.c ds/slice.c + +posix_src = posix/directory-walker.c posix/env.c posix/exec.c \ + posix/files.c posix/process.c posix/subprocess.c + +pthreads_src = pthreads/thread.c +libcork_la_SOURCES = $(cli_src) $(core_src) $(ds_src) \ + $(posix_src) $(pthreads_src) + +libcork_la_CFLAGS = -Iinclude -DCORK_API=CORK_LOCAL +libcork_la_LDFLAGS = -static +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libcork/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libcork/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +cli/$(am__dirstamp): + @$(MKDIR_P) cli + @: > cli/$(am__dirstamp) +cli/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cli/$(DEPDIR) + @: > cli/$(DEPDIR)/$(am__dirstamp) +cli/libcork_la-commands.lo: cli/$(am__dirstamp) \ + cli/$(DEPDIR)/$(am__dirstamp) +core/$(am__dirstamp): + @$(MKDIR_P) core + @: > core/$(am__dirstamp) +core/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) core/$(DEPDIR) + @: > core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-allocator.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-error.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-gc.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-hash.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-ip-address.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-mempool.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-timestamp.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-u128.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +ds/$(am__dirstamp): + @$(MKDIR_P) ds + @: > ds/$(am__dirstamp) +ds/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ds/$(DEPDIR) + @: > ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-array.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-bitset.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-buffer.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-dllist.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-file-stream.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-hash-table.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-managed-buffer.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-ring-buffer.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-slice.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +posix/$(am__dirstamp): + @$(MKDIR_P) posix + @: > posix/$(am__dirstamp) +posix/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) posix/$(DEPDIR) + @: > posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-directory-walker.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-env.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-exec.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-files.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-process.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-subprocess.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +pthreads/$(am__dirstamp): + @$(MKDIR_P) pthreads + @: > pthreads/$(am__dirstamp) +pthreads/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) pthreads/$(DEPDIR) + @: > pthreads/$(DEPDIR)/$(am__dirstamp) +pthreads/libcork_la-thread.lo: pthreads/$(am__dirstamp) \ + pthreads/$(DEPDIR)/$(am__dirstamp) + +libcork.la: $(libcork_la_OBJECTS) $(libcork_la_DEPENDENCIES) $(EXTRA_libcork_la_DEPENDENCIES) + $(AM_V_CCLD)$(libcork_la_LINK) $(libcork_la_OBJECTS) $(libcork_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f cli/*.$(OBJEXT) + -rm -f cli/*.lo + -rm -f core/*.$(OBJEXT) + -rm -f core/*.lo + -rm -f ds/*.$(OBJEXT) + -rm -f ds/*.lo + -rm -f posix/*.$(OBJEXT) + -rm -f posix/*.lo + -rm -f pthreads/*.$(OBJEXT) + -rm -f pthreads/*.lo + +distclean-compile: + -rm -f *.tab.c + +include cli/$(DEPDIR)/libcork_la-commands.Plo +include core/$(DEPDIR)/libcork_la-allocator.Plo +include core/$(DEPDIR)/libcork_la-error.Plo +include core/$(DEPDIR)/libcork_la-gc.Plo +include core/$(DEPDIR)/libcork_la-hash.Plo +include core/$(DEPDIR)/libcork_la-ip-address.Plo +include core/$(DEPDIR)/libcork_la-mempool.Plo +include core/$(DEPDIR)/libcork_la-timestamp.Plo +include core/$(DEPDIR)/libcork_la-u128.Plo +include ds/$(DEPDIR)/libcork_la-array.Plo +include ds/$(DEPDIR)/libcork_la-bitset.Plo +include ds/$(DEPDIR)/libcork_la-buffer.Plo +include ds/$(DEPDIR)/libcork_la-dllist.Plo +include ds/$(DEPDIR)/libcork_la-file-stream.Plo +include ds/$(DEPDIR)/libcork_la-hash-table.Plo +include ds/$(DEPDIR)/libcork_la-managed-buffer.Plo +include ds/$(DEPDIR)/libcork_la-ring-buffer.Plo +include ds/$(DEPDIR)/libcork_la-slice.Plo +include posix/$(DEPDIR)/libcork_la-directory-walker.Plo +include posix/$(DEPDIR)/libcork_la-env.Plo +include posix/$(DEPDIR)/libcork_la-exec.Plo +include posix/$(DEPDIR)/libcork_la-files.Plo +include posix/$(DEPDIR)/libcork_la-process.Plo +include posix/$(DEPDIR)/libcork_la-subprocess.Plo +include pthreads/$(DEPDIR)/libcork_la-thread.Plo + +.c.o: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ + $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ + $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ + $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Plo +# $(AM_V_CC)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< + +cli/libcork_la-commands.lo: cli/commands.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT cli/libcork_la-commands.lo -MD -MP -MF cli/$(DEPDIR)/libcork_la-commands.Tpo -c -o cli/libcork_la-commands.lo `test -f 'cli/commands.c' || echo '$(srcdir)/'`cli/commands.c + $(AM_V_at)$(am__mv) cli/$(DEPDIR)/libcork_la-commands.Tpo cli/$(DEPDIR)/libcork_la-commands.Plo +# $(AM_V_CC)source='cli/commands.c' object='cli/libcork_la-commands.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o cli/libcork_la-commands.lo `test -f 'cli/commands.c' || echo '$(srcdir)/'`cli/commands.c + +core/libcork_la-allocator.lo: core/allocator.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-allocator.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-allocator.Tpo -c -o core/libcork_la-allocator.lo `test -f 'core/allocator.c' || echo '$(srcdir)/'`core/allocator.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-allocator.Tpo core/$(DEPDIR)/libcork_la-allocator.Plo +# $(AM_V_CC)source='core/allocator.c' object='core/libcork_la-allocator.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-allocator.lo `test -f 'core/allocator.c' || echo '$(srcdir)/'`core/allocator.c + +core/libcork_la-error.lo: core/error.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-error.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-error.Tpo -c -o core/libcork_la-error.lo `test -f 'core/error.c' || echo '$(srcdir)/'`core/error.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-error.Tpo core/$(DEPDIR)/libcork_la-error.Plo +# $(AM_V_CC)source='core/error.c' object='core/libcork_la-error.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-error.lo `test -f 'core/error.c' || echo '$(srcdir)/'`core/error.c + +core/libcork_la-gc.lo: core/gc.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-gc.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-gc.Tpo -c -o core/libcork_la-gc.lo `test -f 'core/gc.c' || echo '$(srcdir)/'`core/gc.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-gc.Tpo core/$(DEPDIR)/libcork_la-gc.Plo +# $(AM_V_CC)source='core/gc.c' object='core/libcork_la-gc.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-gc.lo `test -f 'core/gc.c' || echo '$(srcdir)/'`core/gc.c + +core/libcork_la-hash.lo: core/hash.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-hash.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-hash.Tpo -c -o core/libcork_la-hash.lo `test -f 'core/hash.c' || echo '$(srcdir)/'`core/hash.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-hash.Tpo core/$(DEPDIR)/libcork_la-hash.Plo +# $(AM_V_CC)source='core/hash.c' object='core/libcork_la-hash.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-hash.lo `test -f 'core/hash.c' || echo '$(srcdir)/'`core/hash.c + +core/libcork_la-ip-address.lo: core/ip-address.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-ip-address.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-ip-address.Tpo -c -o core/libcork_la-ip-address.lo `test -f 'core/ip-address.c' || echo '$(srcdir)/'`core/ip-address.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-ip-address.Tpo core/$(DEPDIR)/libcork_la-ip-address.Plo +# $(AM_V_CC)source='core/ip-address.c' object='core/libcork_la-ip-address.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-ip-address.lo `test -f 'core/ip-address.c' || echo '$(srcdir)/'`core/ip-address.c + +core/libcork_la-mempool.lo: core/mempool.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-mempool.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-mempool.Tpo -c -o core/libcork_la-mempool.lo `test -f 'core/mempool.c' || echo '$(srcdir)/'`core/mempool.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-mempool.Tpo core/$(DEPDIR)/libcork_la-mempool.Plo +# $(AM_V_CC)source='core/mempool.c' object='core/libcork_la-mempool.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-mempool.lo `test -f 'core/mempool.c' || echo '$(srcdir)/'`core/mempool.c + +core/libcork_la-timestamp.lo: core/timestamp.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-timestamp.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-timestamp.Tpo -c -o core/libcork_la-timestamp.lo `test -f 'core/timestamp.c' || echo '$(srcdir)/'`core/timestamp.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-timestamp.Tpo core/$(DEPDIR)/libcork_la-timestamp.Plo +# $(AM_V_CC)source='core/timestamp.c' object='core/libcork_la-timestamp.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-timestamp.lo `test -f 'core/timestamp.c' || echo '$(srcdir)/'`core/timestamp.c + +core/libcork_la-u128.lo: core/u128.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-u128.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-u128.Tpo -c -o core/libcork_la-u128.lo `test -f 'core/u128.c' || echo '$(srcdir)/'`core/u128.c + $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-u128.Tpo core/$(DEPDIR)/libcork_la-u128.Plo +# $(AM_V_CC)source='core/u128.c' object='core/libcork_la-u128.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-u128.lo `test -f 'core/u128.c' || echo '$(srcdir)/'`core/u128.c + +ds/libcork_la-array.lo: ds/array.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-array.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-array.Tpo -c -o ds/libcork_la-array.lo `test -f 'ds/array.c' || echo '$(srcdir)/'`ds/array.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-array.Tpo ds/$(DEPDIR)/libcork_la-array.Plo +# $(AM_V_CC)source='ds/array.c' object='ds/libcork_la-array.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-array.lo `test -f 'ds/array.c' || echo '$(srcdir)/'`ds/array.c + +ds/libcork_la-bitset.lo: ds/bitset.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-bitset.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-bitset.Tpo -c -o ds/libcork_la-bitset.lo `test -f 'ds/bitset.c' || echo '$(srcdir)/'`ds/bitset.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-bitset.Tpo ds/$(DEPDIR)/libcork_la-bitset.Plo +# $(AM_V_CC)source='ds/bitset.c' object='ds/libcork_la-bitset.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-bitset.lo `test -f 'ds/bitset.c' || echo '$(srcdir)/'`ds/bitset.c + +ds/libcork_la-buffer.lo: ds/buffer.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-buffer.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-buffer.Tpo -c -o ds/libcork_la-buffer.lo `test -f 'ds/buffer.c' || echo '$(srcdir)/'`ds/buffer.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-buffer.Tpo ds/$(DEPDIR)/libcork_la-buffer.Plo +# $(AM_V_CC)source='ds/buffer.c' object='ds/libcork_la-buffer.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-buffer.lo `test -f 'ds/buffer.c' || echo '$(srcdir)/'`ds/buffer.c + +ds/libcork_la-dllist.lo: ds/dllist.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-dllist.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-dllist.Tpo -c -o ds/libcork_la-dllist.lo `test -f 'ds/dllist.c' || echo '$(srcdir)/'`ds/dllist.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-dllist.Tpo ds/$(DEPDIR)/libcork_la-dllist.Plo +# $(AM_V_CC)source='ds/dllist.c' object='ds/libcork_la-dllist.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-dllist.lo `test -f 'ds/dllist.c' || echo '$(srcdir)/'`ds/dllist.c + +ds/libcork_la-file-stream.lo: ds/file-stream.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-file-stream.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-file-stream.Tpo -c -o ds/libcork_la-file-stream.lo `test -f 'ds/file-stream.c' || echo '$(srcdir)/'`ds/file-stream.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-file-stream.Tpo ds/$(DEPDIR)/libcork_la-file-stream.Plo +# $(AM_V_CC)source='ds/file-stream.c' object='ds/libcork_la-file-stream.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-file-stream.lo `test -f 'ds/file-stream.c' || echo '$(srcdir)/'`ds/file-stream.c + +ds/libcork_la-hash-table.lo: ds/hash-table.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-hash-table.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-hash-table.Tpo -c -o ds/libcork_la-hash-table.lo `test -f 'ds/hash-table.c' || echo '$(srcdir)/'`ds/hash-table.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-hash-table.Tpo ds/$(DEPDIR)/libcork_la-hash-table.Plo +# $(AM_V_CC)source='ds/hash-table.c' object='ds/libcork_la-hash-table.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-hash-table.lo `test -f 'ds/hash-table.c' || echo '$(srcdir)/'`ds/hash-table.c + +ds/libcork_la-managed-buffer.lo: ds/managed-buffer.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-managed-buffer.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-managed-buffer.Tpo -c -o ds/libcork_la-managed-buffer.lo `test -f 'ds/managed-buffer.c' || echo '$(srcdir)/'`ds/managed-buffer.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-managed-buffer.Tpo ds/$(DEPDIR)/libcork_la-managed-buffer.Plo +# $(AM_V_CC)source='ds/managed-buffer.c' object='ds/libcork_la-managed-buffer.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-managed-buffer.lo `test -f 'ds/managed-buffer.c' || echo '$(srcdir)/'`ds/managed-buffer.c + +ds/libcork_la-ring-buffer.lo: ds/ring-buffer.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-ring-buffer.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-ring-buffer.Tpo -c -o ds/libcork_la-ring-buffer.lo `test -f 'ds/ring-buffer.c' || echo '$(srcdir)/'`ds/ring-buffer.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-ring-buffer.Tpo ds/$(DEPDIR)/libcork_la-ring-buffer.Plo +# $(AM_V_CC)source='ds/ring-buffer.c' object='ds/libcork_la-ring-buffer.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-ring-buffer.lo `test -f 'ds/ring-buffer.c' || echo '$(srcdir)/'`ds/ring-buffer.c + +ds/libcork_la-slice.lo: ds/slice.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-slice.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-slice.Tpo -c -o ds/libcork_la-slice.lo `test -f 'ds/slice.c' || echo '$(srcdir)/'`ds/slice.c + $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-slice.Tpo ds/$(DEPDIR)/libcork_la-slice.Plo +# $(AM_V_CC)source='ds/slice.c' object='ds/libcork_la-slice.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-slice.lo `test -f 'ds/slice.c' || echo '$(srcdir)/'`ds/slice.c + +posix/libcork_la-directory-walker.lo: posix/directory-walker.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-directory-walker.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-directory-walker.Tpo -c -o posix/libcork_la-directory-walker.lo `test -f 'posix/directory-walker.c' || echo '$(srcdir)/'`posix/directory-walker.c + $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-directory-walker.Tpo posix/$(DEPDIR)/libcork_la-directory-walker.Plo +# $(AM_V_CC)source='posix/directory-walker.c' object='posix/libcork_la-directory-walker.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-directory-walker.lo `test -f 'posix/directory-walker.c' || echo '$(srcdir)/'`posix/directory-walker.c + +posix/libcork_la-env.lo: posix/env.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-env.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-env.Tpo -c -o posix/libcork_la-env.lo `test -f 'posix/env.c' || echo '$(srcdir)/'`posix/env.c + $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-env.Tpo posix/$(DEPDIR)/libcork_la-env.Plo +# $(AM_V_CC)source='posix/env.c' object='posix/libcork_la-env.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-env.lo `test -f 'posix/env.c' || echo '$(srcdir)/'`posix/env.c + +posix/libcork_la-exec.lo: posix/exec.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-exec.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-exec.Tpo -c -o posix/libcork_la-exec.lo `test -f 'posix/exec.c' || echo '$(srcdir)/'`posix/exec.c + $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-exec.Tpo posix/$(DEPDIR)/libcork_la-exec.Plo +# $(AM_V_CC)source='posix/exec.c' object='posix/libcork_la-exec.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-exec.lo `test -f 'posix/exec.c' || echo '$(srcdir)/'`posix/exec.c + +posix/libcork_la-files.lo: posix/files.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-files.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-files.Tpo -c -o posix/libcork_la-files.lo `test -f 'posix/files.c' || echo '$(srcdir)/'`posix/files.c + $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-files.Tpo posix/$(DEPDIR)/libcork_la-files.Plo +# $(AM_V_CC)source='posix/files.c' object='posix/libcork_la-files.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-files.lo `test -f 'posix/files.c' || echo '$(srcdir)/'`posix/files.c + +posix/libcork_la-process.lo: posix/process.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-process.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-process.Tpo -c -o posix/libcork_la-process.lo `test -f 'posix/process.c' || echo '$(srcdir)/'`posix/process.c + $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-process.Tpo posix/$(DEPDIR)/libcork_la-process.Plo +# $(AM_V_CC)source='posix/process.c' object='posix/libcork_la-process.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-process.lo `test -f 'posix/process.c' || echo '$(srcdir)/'`posix/process.c + +posix/libcork_la-subprocess.lo: posix/subprocess.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-subprocess.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-subprocess.Tpo -c -o posix/libcork_la-subprocess.lo `test -f 'posix/subprocess.c' || echo '$(srcdir)/'`posix/subprocess.c + $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-subprocess.Tpo posix/$(DEPDIR)/libcork_la-subprocess.Plo +# $(AM_V_CC)source='posix/subprocess.c' object='posix/libcork_la-subprocess.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-subprocess.lo `test -f 'posix/subprocess.c' || echo '$(srcdir)/'`posix/subprocess.c + +pthreads/libcork_la-thread.lo: pthreads/thread.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT pthreads/libcork_la-thread.lo -MD -MP -MF pthreads/$(DEPDIR)/libcork_la-thread.Tpo -c -o pthreads/libcork_la-thread.lo `test -f 'pthreads/thread.c' || echo '$(srcdir)/'`pthreads/thread.c + $(AM_V_at)$(am__mv) pthreads/$(DEPDIR)/libcork_la-thread.Tpo pthreads/$(DEPDIR)/libcork_la-thread.Plo +# $(AM_V_CC)source='pthreads/thread.c' object='pthreads/libcork_la-thread.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o pthreads/libcork_la-thread.lo `test -f 'pthreads/thread.c' || echo '$(srcdir)/'`pthreads/thread.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf cli/.libs cli/_libs + -rm -rf core/.libs core/_libs + -rm -rf ds/.libs ds/_libs + -rm -rf posix/.libs posix/_libs + -rm -rf pthreads/.libs pthreads/_libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f cli/$(DEPDIR)/$(am__dirstamp) + -rm -f cli/$(am__dirstamp) + -rm -f core/$(DEPDIR)/$(am__dirstamp) + -rm -f core/$(am__dirstamp) + -rm -f ds/$(DEPDIR)/$(am__dirstamp) + -rm -f ds/$(am__dirstamp) + -rm -f posix/$(DEPDIR)/$(am__dirstamp) + -rm -f posix/$(am__dirstamp) + -rm -f pthreads/$(DEPDIR)/$(am__dirstamp) + -rm -f pthreads/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf cli/$(DEPDIR) core/$(DEPDIR) ds/$(DEPDIR) posix/$(DEPDIR) pthreads/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf cli/$(DEPDIR) core/$(DEPDIR) ds/$(DEPDIR) posix/$(DEPDIR) pthreads/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libcork/Makefile.am b/libcork/Makefile.am new file mode 100644 index 00000000..8b1719e1 --- /dev/null +++ b/libcork/Makefile.am @@ -0,0 +1,36 @@ +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + +noinst_LTLIBRARIES = libcork.la + +cli_src = cli/commands.c +core_src = core/allocator.c core/error.c core/gc.c \ + core/hash.c core/ip-address.c core/mempool.c \ + core/timestamp.c core/u128.c +ds_src = ds/array.c ds/bitset.c ds/buffer.c ds/dllist.c \ + ds/file-stream.c ds/hash-table.c ds/managed-buffer.c \ + ds/ring-buffer.c ds/slice.c +posix_src = posix/directory-walker.c posix/env.c posix/exec.c \ + posix/files.c posix/process.c posix/subprocess.c +pthreads_src = pthreads/thread.c + +libcork_la_SOURCES = $(cli_src) $(core_src) $(ds_src) \ + $(posix_src) $(pthreads_src) +libcork_la_CFLAGS = -Iinclude -DCORK_API=CORK_LOCAL + +libcork_la_LDFLAGS = -static diff --git a/libcork/Makefile.in b/libcork/Makefile.in new file mode 100644 index 00000000..7719206b --- /dev/null +++ b/libcork/Makefile.in @@ -0,0 +1,939 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = libcork +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ + $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libcork_la_LIBADD = +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_1 = cli/libcork_la-commands.lo +am__objects_2 = core/libcork_la-allocator.lo core/libcork_la-error.lo \ + core/libcork_la-gc.lo core/libcork_la-hash.lo \ + core/libcork_la-ip-address.lo core/libcork_la-mempool.lo \ + core/libcork_la-timestamp.lo core/libcork_la-u128.lo +am__objects_3 = ds/libcork_la-array.lo ds/libcork_la-bitset.lo \ + ds/libcork_la-buffer.lo ds/libcork_la-dllist.lo \ + ds/libcork_la-file-stream.lo ds/libcork_la-hash-table.lo \ + ds/libcork_la-managed-buffer.lo ds/libcork_la-ring-buffer.lo \ + ds/libcork_la-slice.lo +am__objects_4 = posix/libcork_la-directory-walker.lo \ + posix/libcork_la-env.lo posix/libcork_la-exec.lo \ + posix/libcork_la-files.lo posix/libcork_la-process.lo \ + posix/libcork_la-subprocess.lo +am__objects_5 = pthreads/libcork_la-thread.lo +am_libcork_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) +libcork_la_OBJECTS = $(am_libcork_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libcork_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libcork_la_CFLAGS) \ + $(CFLAGS) $(libcork_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libcork_la_SOURCES) +DIST_SOURCES = $(libcork_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INET_NTOP_LIB = @INET_NTOP_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libcork.la +cli_src = cli/commands.c +core_src = core/allocator.c core/error.c core/gc.c \ + core/hash.c core/ip-address.c core/mempool.c \ + core/timestamp.c core/u128.c + +ds_src = ds/array.c ds/bitset.c ds/buffer.c ds/dllist.c \ + ds/file-stream.c ds/hash-table.c ds/managed-buffer.c \ + ds/ring-buffer.c ds/slice.c + +posix_src = posix/directory-walker.c posix/env.c posix/exec.c \ + posix/files.c posix/process.c posix/subprocess.c + +pthreads_src = pthreads/thread.c +libcork_la_SOURCES = $(cli_src) $(core_src) $(ds_src) \ + $(posix_src) $(pthreads_src) + +libcork_la_CFLAGS = -Iinclude -DCORK_API=CORK_LOCAL +libcork_la_LDFLAGS = -static +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libcork/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libcork/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +cli/$(am__dirstamp): + @$(MKDIR_P) cli + @: > cli/$(am__dirstamp) +cli/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) cli/$(DEPDIR) + @: > cli/$(DEPDIR)/$(am__dirstamp) +cli/libcork_la-commands.lo: cli/$(am__dirstamp) \ + cli/$(DEPDIR)/$(am__dirstamp) +core/$(am__dirstamp): + @$(MKDIR_P) core + @: > core/$(am__dirstamp) +core/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) core/$(DEPDIR) + @: > core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-allocator.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-error.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-gc.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-hash.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-ip-address.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-mempool.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-timestamp.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +core/libcork_la-u128.lo: core/$(am__dirstamp) \ + core/$(DEPDIR)/$(am__dirstamp) +ds/$(am__dirstamp): + @$(MKDIR_P) ds + @: > ds/$(am__dirstamp) +ds/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) ds/$(DEPDIR) + @: > ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-array.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-bitset.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-buffer.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-dllist.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-file-stream.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-hash-table.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-managed-buffer.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-ring-buffer.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +ds/libcork_la-slice.lo: ds/$(am__dirstamp) \ + ds/$(DEPDIR)/$(am__dirstamp) +posix/$(am__dirstamp): + @$(MKDIR_P) posix + @: > posix/$(am__dirstamp) +posix/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) posix/$(DEPDIR) + @: > posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-directory-walker.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-env.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-exec.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-files.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-process.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +posix/libcork_la-subprocess.lo: posix/$(am__dirstamp) \ + posix/$(DEPDIR)/$(am__dirstamp) +pthreads/$(am__dirstamp): + @$(MKDIR_P) pthreads + @: > pthreads/$(am__dirstamp) +pthreads/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) pthreads/$(DEPDIR) + @: > pthreads/$(DEPDIR)/$(am__dirstamp) +pthreads/libcork_la-thread.lo: pthreads/$(am__dirstamp) \ + pthreads/$(DEPDIR)/$(am__dirstamp) + +libcork.la: $(libcork_la_OBJECTS) $(libcork_la_DEPENDENCIES) $(EXTRA_libcork_la_DEPENDENCIES) + $(AM_V_CCLD)$(libcork_la_LINK) $(libcork_la_OBJECTS) $(libcork_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f cli/*.$(OBJEXT) + -rm -f cli/*.lo + -rm -f core/*.$(OBJEXT) + -rm -f core/*.lo + -rm -f ds/*.$(OBJEXT) + -rm -f ds/*.lo + -rm -f posix/*.$(OBJEXT) + -rm -f posix/*.lo + -rm -f pthreads/*.$(OBJEXT) + -rm -f pthreads/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@cli/$(DEPDIR)/libcork_la-commands.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-allocator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-error.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-gc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-hash.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-ip-address.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-mempool.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-timestamp.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@core/$(DEPDIR)/libcork_la-u128.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-array.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-bitset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-dllist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-file-stream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-hash-table.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-managed-buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-ring-buffer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ds/$(DEPDIR)/libcork_la-slice.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/libcork_la-directory-walker.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/libcork_la-env.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/libcork_la-exec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/libcork_la-files.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/libcork_la-process.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@posix/$(DEPDIR)/libcork_la-subprocess.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@pthreads/$(DEPDIR)/libcork_la-thread.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +cli/libcork_la-commands.lo: cli/commands.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT cli/libcork_la-commands.lo -MD -MP -MF cli/$(DEPDIR)/libcork_la-commands.Tpo -c -o cli/libcork_la-commands.lo `test -f 'cli/commands.c' || echo '$(srcdir)/'`cli/commands.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cli/$(DEPDIR)/libcork_la-commands.Tpo cli/$(DEPDIR)/libcork_la-commands.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cli/commands.c' object='cli/libcork_la-commands.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o cli/libcork_la-commands.lo `test -f 'cli/commands.c' || echo '$(srcdir)/'`cli/commands.c + +core/libcork_la-allocator.lo: core/allocator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-allocator.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-allocator.Tpo -c -o core/libcork_la-allocator.lo `test -f 'core/allocator.c' || echo '$(srcdir)/'`core/allocator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-allocator.Tpo core/$(DEPDIR)/libcork_la-allocator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/allocator.c' object='core/libcork_la-allocator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-allocator.lo `test -f 'core/allocator.c' || echo '$(srcdir)/'`core/allocator.c + +core/libcork_la-error.lo: core/error.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-error.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-error.Tpo -c -o core/libcork_la-error.lo `test -f 'core/error.c' || echo '$(srcdir)/'`core/error.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-error.Tpo core/$(DEPDIR)/libcork_la-error.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/error.c' object='core/libcork_la-error.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-error.lo `test -f 'core/error.c' || echo '$(srcdir)/'`core/error.c + +core/libcork_la-gc.lo: core/gc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-gc.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-gc.Tpo -c -o core/libcork_la-gc.lo `test -f 'core/gc.c' || echo '$(srcdir)/'`core/gc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-gc.Tpo core/$(DEPDIR)/libcork_la-gc.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/gc.c' object='core/libcork_la-gc.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-gc.lo `test -f 'core/gc.c' || echo '$(srcdir)/'`core/gc.c + +core/libcork_la-hash.lo: core/hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-hash.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-hash.Tpo -c -o core/libcork_la-hash.lo `test -f 'core/hash.c' || echo '$(srcdir)/'`core/hash.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-hash.Tpo core/$(DEPDIR)/libcork_la-hash.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/hash.c' object='core/libcork_la-hash.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-hash.lo `test -f 'core/hash.c' || echo '$(srcdir)/'`core/hash.c + +core/libcork_la-ip-address.lo: core/ip-address.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-ip-address.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-ip-address.Tpo -c -o core/libcork_la-ip-address.lo `test -f 'core/ip-address.c' || echo '$(srcdir)/'`core/ip-address.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-ip-address.Tpo core/$(DEPDIR)/libcork_la-ip-address.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/ip-address.c' object='core/libcork_la-ip-address.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-ip-address.lo `test -f 'core/ip-address.c' || echo '$(srcdir)/'`core/ip-address.c + +core/libcork_la-mempool.lo: core/mempool.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-mempool.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-mempool.Tpo -c -o core/libcork_la-mempool.lo `test -f 'core/mempool.c' || echo '$(srcdir)/'`core/mempool.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-mempool.Tpo core/$(DEPDIR)/libcork_la-mempool.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/mempool.c' object='core/libcork_la-mempool.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-mempool.lo `test -f 'core/mempool.c' || echo '$(srcdir)/'`core/mempool.c + +core/libcork_la-timestamp.lo: core/timestamp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-timestamp.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-timestamp.Tpo -c -o core/libcork_la-timestamp.lo `test -f 'core/timestamp.c' || echo '$(srcdir)/'`core/timestamp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-timestamp.Tpo core/$(DEPDIR)/libcork_la-timestamp.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/timestamp.c' object='core/libcork_la-timestamp.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-timestamp.lo `test -f 'core/timestamp.c' || echo '$(srcdir)/'`core/timestamp.c + +core/libcork_la-u128.lo: core/u128.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT core/libcork_la-u128.lo -MD -MP -MF core/$(DEPDIR)/libcork_la-u128.Tpo -c -o core/libcork_la-u128.lo `test -f 'core/u128.c' || echo '$(srcdir)/'`core/u128.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) core/$(DEPDIR)/libcork_la-u128.Tpo core/$(DEPDIR)/libcork_la-u128.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='core/u128.c' object='core/libcork_la-u128.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o core/libcork_la-u128.lo `test -f 'core/u128.c' || echo '$(srcdir)/'`core/u128.c + +ds/libcork_la-array.lo: ds/array.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-array.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-array.Tpo -c -o ds/libcork_la-array.lo `test -f 'ds/array.c' || echo '$(srcdir)/'`ds/array.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-array.Tpo ds/$(DEPDIR)/libcork_la-array.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/array.c' object='ds/libcork_la-array.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-array.lo `test -f 'ds/array.c' || echo '$(srcdir)/'`ds/array.c + +ds/libcork_la-bitset.lo: ds/bitset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-bitset.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-bitset.Tpo -c -o ds/libcork_la-bitset.lo `test -f 'ds/bitset.c' || echo '$(srcdir)/'`ds/bitset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-bitset.Tpo ds/$(DEPDIR)/libcork_la-bitset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/bitset.c' object='ds/libcork_la-bitset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-bitset.lo `test -f 'ds/bitset.c' || echo '$(srcdir)/'`ds/bitset.c + +ds/libcork_la-buffer.lo: ds/buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-buffer.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-buffer.Tpo -c -o ds/libcork_la-buffer.lo `test -f 'ds/buffer.c' || echo '$(srcdir)/'`ds/buffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-buffer.Tpo ds/$(DEPDIR)/libcork_la-buffer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/buffer.c' object='ds/libcork_la-buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-buffer.lo `test -f 'ds/buffer.c' || echo '$(srcdir)/'`ds/buffer.c + +ds/libcork_la-dllist.lo: ds/dllist.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-dllist.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-dllist.Tpo -c -o ds/libcork_la-dllist.lo `test -f 'ds/dllist.c' || echo '$(srcdir)/'`ds/dllist.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-dllist.Tpo ds/$(DEPDIR)/libcork_la-dllist.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/dllist.c' object='ds/libcork_la-dllist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-dllist.lo `test -f 'ds/dllist.c' || echo '$(srcdir)/'`ds/dllist.c + +ds/libcork_la-file-stream.lo: ds/file-stream.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-file-stream.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-file-stream.Tpo -c -o ds/libcork_la-file-stream.lo `test -f 'ds/file-stream.c' || echo '$(srcdir)/'`ds/file-stream.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-file-stream.Tpo ds/$(DEPDIR)/libcork_la-file-stream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/file-stream.c' object='ds/libcork_la-file-stream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-file-stream.lo `test -f 'ds/file-stream.c' || echo '$(srcdir)/'`ds/file-stream.c + +ds/libcork_la-hash-table.lo: ds/hash-table.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-hash-table.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-hash-table.Tpo -c -o ds/libcork_la-hash-table.lo `test -f 'ds/hash-table.c' || echo '$(srcdir)/'`ds/hash-table.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-hash-table.Tpo ds/$(DEPDIR)/libcork_la-hash-table.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/hash-table.c' object='ds/libcork_la-hash-table.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-hash-table.lo `test -f 'ds/hash-table.c' || echo '$(srcdir)/'`ds/hash-table.c + +ds/libcork_la-managed-buffer.lo: ds/managed-buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-managed-buffer.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-managed-buffer.Tpo -c -o ds/libcork_la-managed-buffer.lo `test -f 'ds/managed-buffer.c' || echo '$(srcdir)/'`ds/managed-buffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-managed-buffer.Tpo ds/$(DEPDIR)/libcork_la-managed-buffer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/managed-buffer.c' object='ds/libcork_la-managed-buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-managed-buffer.lo `test -f 'ds/managed-buffer.c' || echo '$(srcdir)/'`ds/managed-buffer.c + +ds/libcork_la-ring-buffer.lo: ds/ring-buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-ring-buffer.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-ring-buffer.Tpo -c -o ds/libcork_la-ring-buffer.lo `test -f 'ds/ring-buffer.c' || echo '$(srcdir)/'`ds/ring-buffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-ring-buffer.Tpo ds/$(DEPDIR)/libcork_la-ring-buffer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/ring-buffer.c' object='ds/libcork_la-ring-buffer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-ring-buffer.lo `test -f 'ds/ring-buffer.c' || echo '$(srcdir)/'`ds/ring-buffer.c + +ds/libcork_la-slice.lo: ds/slice.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT ds/libcork_la-slice.lo -MD -MP -MF ds/$(DEPDIR)/libcork_la-slice.Tpo -c -o ds/libcork_la-slice.lo `test -f 'ds/slice.c' || echo '$(srcdir)/'`ds/slice.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ds/$(DEPDIR)/libcork_la-slice.Tpo ds/$(DEPDIR)/libcork_la-slice.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ds/slice.c' object='ds/libcork_la-slice.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o ds/libcork_la-slice.lo `test -f 'ds/slice.c' || echo '$(srcdir)/'`ds/slice.c + +posix/libcork_la-directory-walker.lo: posix/directory-walker.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-directory-walker.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-directory-walker.Tpo -c -o posix/libcork_la-directory-walker.lo `test -f 'posix/directory-walker.c' || echo '$(srcdir)/'`posix/directory-walker.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-directory-walker.Tpo posix/$(DEPDIR)/libcork_la-directory-walker.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='posix/directory-walker.c' object='posix/libcork_la-directory-walker.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-directory-walker.lo `test -f 'posix/directory-walker.c' || echo '$(srcdir)/'`posix/directory-walker.c + +posix/libcork_la-env.lo: posix/env.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-env.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-env.Tpo -c -o posix/libcork_la-env.lo `test -f 'posix/env.c' || echo '$(srcdir)/'`posix/env.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-env.Tpo posix/$(DEPDIR)/libcork_la-env.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='posix/env.c' object='posix/libcork_la-env.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-env.lo `test -f 'posix/env.c' || echo '$(srcdir)/'`posix/env.c + +posix/libcork_la-exec.lo: posix/exec.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-exec.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-exec.Tpo -c -o posix/libcork_la-exec.lo `test -f 'posix/exec.c' || echo '$(srcdir)/'`posix/exec.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-exec.Tpo posix/$(DEPDIR)/libcork_la-exec.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='posix/exec.c' object='posix/libcork_la-exec.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-exec.lo `test -f 'posix/exec.c' || echo '$(srcdir)/'`posix/exec.c + +posix/libcork_la-files.lo: posix/files.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-files.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-files.Tpo -c -o posix/libcork_la-files.lo `test -f 'posix/files.c' || echo '$(srcdir)/'`posix/files.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-files.Tpo posix/$(DEPDIR)/libcork_la-files.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='posix/files.c' object='posix/libcork_la-files.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-files.lo `test -f 'posix/files.c' || echo '$(srcdir)/'`posix/files.c + +posix/libcork_la-process.lo: posix/process.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-process.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-process.Tpo -c -o posix/libcork_la-process.lo `test -f 'posix/process.c' || echo '$(srcdir)/'`posix/process.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-process.Tpo posix/$(DEPDIR)/libcork_la-process.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='posix/process.c' object='posix/libcork_la-process.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-process.lo `test -f 'posix/process.c' || echo '$(srcdir)/'`posix/process.c + +posix/libcork_la-subprocess.lo: posix/subprocess.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT posix/libcork_la-subprocess.lo -MD -MP -MF posix/$(DEPDIR)/libcork_la-subprocess.Tpo -c -o posix/libcork_la-subprocess.lo `test -f 'posix/subprocess.c' || echo '$(srcdir)/'`posix/subprocess.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) posix/$(DEPDIR)/libcork_la-subprocess.Tpo posix/$(DEPDIR)/libcork_la-subprocess.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='posix/subprocess.c' object='posix/libcork_la-subprocess.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o posix/libcork_la-subprocess.lo `test -f 'posix/subprocess.c' || echo '$(srcdir)/'`posix/subprocess.c + +pthreads/libcork_la-thread.lo: pthreads/thread.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -MT pthreads/libcork_la-thread.lo -MD -MP -MF pthreads/$(DEPDIR)/libcork_la-thread.Tpo -c -o pthreads/libcork_la-thread.lo `test -f 'pthreads/thread.c' || echo '$(srcdir)/'`pthreads/thread.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) pthreads/$(DEPDIR)/libcork_la-thread.Tpo pthreads/$(DEPDIR)/libcork_la-thread.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pthreads/thread.c' object='pthreads/libcork_la-thread.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libcork_la_CFLAGS) $(CFLAGS) -c -o pthreads/libcork_la-thread.lo `test -f 'pthreads/thread.c' || echo '$(srcdir)/'`pthreads/thread.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf cli/.libs cli/_libs + -rm -rf core/.libs core/_libs + -rm -rf ds/.libs ds/_libs + -rm -rf posix/.libs posix/_libs + -rm -rf pthreads/.libs pthreads/_libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f cli/$(DEPDIR)/$(am__dirstamp) + -rm -f cli/$(am__dirstamp) + -rm -f core/$(DEPDIR)/$(am__dirstamp) + -rm -f core/$(am__dirstamp) + -rm -f ds/$(DEPDIR)/$(am__dirstamp) + -rm -f ds/$(am__dirstamp) + -rm -f posix/$(DEPDIR)/$(am__dirstamp) + -rm -f posix/$(am__dirstamp) + -rm -f pthreads/$(DEPDIR)/$(am__dirstamp) + -rm -f pthreads/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf cli/$(DEPDIR) core/$(DEPDIR) ds/$(DEPDIR) posix/$(DEPDIR) pthreads/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf cli/$(DEPDIR) core/$(DEPDIR) ds/$(DEPDIR) posix/$(DEPDIR) pthreads/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libcork/cli/.dirstamp b/libcork/cli/.dirstamp new file mode 100644 index 00000000..e69de29b diff --git a/libcork/cli/commands.c b/libcork/cli/commands.c new file mode 100644 index 00000000..f5620765 --- /dev/null +++ b/libcork/cli/commands.c @@ -0,0 +1,225 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include + +#include "libcork/cli.h" +#include "libcork/core.h" +#include "libcork/ds.h" + + +#define streq(a,b) (strcmp((a), (b)) == 0) + +static struct cork_buffer breadcrumbs_buf = CORK_BUFFER_INIT(); + +static void +cork_command_add_breadcrumb(struct cork_command *command) +{ + cork_buffer_append_printf(&breadcrumbs_buf, " %s", command->name); +} + +#define cork_command_breadcrumbs() ((char *) breadcrumbs_buf.buf) + +static void +cork_command_run(struct cork_command *command, int argc, char **argv); + +static struct cork_command * +cork_command_set_get_subcommand(struct cork_command *command, + const char *command_name) +{ + struct cork_command **curr; + for (curr = command->set; *curr != NULL; curr++) { + if (streq(command_name, (*curr)->name)) { + return *curr; + } + } + return NULL; +} + +static void +cork_command_set_show_help(struct cork_command *command) +{ + size_t max_length = 0; + struct cork_command **curr; + + /* Calculate the length of the longest command name. */ + for (curr = command->set; *curr != NULL; curr++) { + size_t len = strlen((*curr)->name); + if (len > max_length) { + max_length = len; + } + } + + /* Then print out the available commands. */ + printf("Usage:%s []\n" + "\nAvailable commands:\n", + cork_command_breadcrumbs()); + + for (curr = command->set; *curr != NULL; curr++) { + printf(" %*s", (int) -max_length, (*curr)->name); + if ((*curr)->short_desc != NULL) { + printf(" %s\n", (*curr)->short_desc); + } else { + printf("\n"); + } + } +} + +static void +cork_command_leaf_show_help(struct cork_command *command) +{ + printf("Usage:%s", cork_command_breadcrumbs()); + if (command->usage_suffix != NULL) { + printf(" %s", command->usage_suffix); + } + if (command->full_help != NULL) { + printf("\n\n%s", command->full_help); + } else { + printf("\n"); + } +} + +void +cork_command_show_help(struct cork_command *command, const char *message) +{ + if (message != NULL) { + printf("%s\n", message); + } + + if (command->type == CORK_COMMAND_SET) { + cork_command_set_show_help(command); + } else if (command->type == CORK_LEAF_COMMAND) { + cork_command_leaf_show_help(command); + } +} + +static void +cork_command_set_run_help(struct cork_command *command, int argc, char **argv) +{ + /* When we see the help command when processing a command set, we use any + * remaining arguments to identifity which subcommand the user wants help + * with. */ + + /* Skip over the name of the command set */ + argc--; + argv++; + + while (argc > 0 && command->type == CORK_COMMAND_SET) { + struct cork_command *subcommand = + cork_command_set_get_subcommand(command, argv[0]); + if (subcommand == NULL) { + printf("Unknown command \"%s\".\n" + "Usage:%s []\n", + argv[0], cork_command_breadcrumbs()); + exit(EXIT_FAILURE); + } + + cork_command_add_breadcrumb(subcommand); + command = subcommand; + argc--; + argv++; + } + + cork_command_show_help(command, NULL); +} + +static void +cork_command_set_run(struct cork_command *command, int argc, char **argv) +{ + const char *command_name; + struct cork_command *subcommand; + + if (argc == 0) { + printf("No command given.\n"); + cork_command_set_show_help(command); + exit(EXIT_FAILURE); + } + + command_name = argv[0]; + + /* The "help" command is special. */ + if (streq(command_name, "help")) { + cork_command_set_run_help(command, argc, argv); + return; + } + + /* Otherwise look for a real subcommand with this name. */ + subcommand = cork_command_set_get_subcommand(command, command_name); + if (subcommand == NULL) { + printf("Unknown command \"%s\".\n" + "Usage:%s []\n", + command_name, cork_command_breadcrumbs()); + exit(EXIT_FAILURE); + } else { + cork_command_run(subcommand, argc, argv); + } +} + +static void +cork_command_leaf_run(struct cork_command *command, int argc, char **argv) +{ + command->run(argc, argv); +} + +static void +cork_command_cleanup(void) +{ + cork_buffer_done(&breadcrumbs_buf); +} + +static void +cork_command_run(struct cork_command *command, int argc, char **argv) +{ + cork_command_add_breadcrumb(command); + + /* If the gives the --help option at this point, describe the current + * command. */ + if (argc >= 2 && (streq(argv[1], "--help") || streq(argv[1], "-h"))) { + cork_command_show_help(command, NULL); + return; + } + + /* Otherwise let the command parse any options that occur here. */ + if (command->parse_options != NULL) { + int option_count = command->parse_options(argc, argv); + argc -= option_count; + argv += option_count; + } else { + argc--; + argv++; + } + + switch (command->type) { + case CORK_COMMAND_SET: + cork_command_set_run(command, argc, argv); + return; + + case CORK_LEAF_COMMAND: + cork_command_leaf_run(command, argc, argv); + return; + + default: + cork_unreachable(); + } +} + + +int +cork_command_main(struct cork_command *root, int argc, char **argv) +{ + /* Clean up after ourselves when the command finishes. */ + atexit(cork_command_cleanup); + + /* Run the root command. */ + cork_command_run(root, argc, argv); + return EXIT_SUCCESS; +} diff --git a/libcork/ds/.dirstamp b/libcork/ds/.dirstamp new file mode 100644 index 00000000..e69de29b diff --git a/libcork/ds/array.c b/libcork/ds/array.c new file mode 100644 index 00000000..8fa09b60 --- /dev/null +++ b/libcork/ds/array.c @@ -0,0 +1,370 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include + +#include "libcork/core/types.h" +#include "libcork/ds/array.h" +#include "libcork/helpers/errors.h" + +#ifndef CORK_ARRAY_DEBUG +#define CORK_ARRAY_DEBUG 0 +#endif + +#if CORK_ARRAY_DEBUG +#include +#define DEBUG(...) \ + do { \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + } while (0) +#else +#define DEBUG(...) /* nothing */ +#endif + + +/*----------------------------------------------------------------------- + * Resizable arrays + */ + +struct cork_array_priv { + size_t allocated_count; + size_t allocated_size; + size_t element_size; + size_t initialized_count; + void *user_data; + cork_free_f free_user_data; + cork_init_f init; + cork_done_f done; + cork_init_f reuse; + cork_done_f remove; +}; + +void +cork_raw_array_init(struct cork_raw_array *array, size_t element_size) +{ + array->items = NULL; + array->size = 0; + array->priv = cork_new(struct cork_array_priv); + array->priv->allocated_count = 0; + array->priv->allocated_size = 0; + array->priv->element_size = element_size; + array->priv->initialized_count = 0; + array->priv->user_data = NULL; + array->priv->free_user_data = NULL; + array->priv->init = NULL; + array->priv->done = NULL; + array->priv->reuse = NULL; + array->priv->remove = NULL; +} + +void +cork_raw_array_done(struct cork_raw_array *array) +{ + if (array->priv->done != NULL) { + size_t i; + char *element = array->items; + for (i = 0; i < array->priv->initialized_count; i++) { + array->priv->done(array->priv->user_data, element); + element += array->priv->element_size; + } + } + if (array->items != NULL) { + free(array->items); + } + cork_free_user_data(array->priv); + free(array->priv); +} + +void +cork_raw_array_set_callback_data(struct cork_raw_array *array, + void *user_data, cork_free_f free_user_data) +{ + array->priv->user_data = user_data; + array->priv->free_user_data = free_user_data; +} + +void +cork_raw_array_set_init(struct cork_raw_array *array, cork_init_f init) +{ + array->priv->init = init; +} + +void +cork_raw_array_set_done(struct cork_raw_array *array, cork_done_f done) +{ + array->priv->done = done; +} + +void +cork_raw_array_set_reuse(struct cork_raw_array *array, cork_init_f reuse) +{ + array->priv->reuse = reuse; +} + +void +cork_raw_array_set_remove(struct cork_raw_array *array, cork_done_f remove) +{ + array->priv->remove = remove; +} + +size_t +cork_raw_array_element_size(const struct cork_raw_array *array) +{ + return array->priv->element_size; +} + +void +cork_raw_array_clear(struct cork_raw_array *array) +{ + if (array->priv->remove != NULL) { + size_t i; + char *element = array->items; + for (i = 0; i < array->priv->initialized_count; i++) { + array->priv->remove(array->priv->user_data, element); + element += array->priv->element_size; + } + } + array->size = 0; +} + +void * +cork_raw_array_elements(const struct cork_raw_array *array) +{ + return array->items; +} + +void * +cork_raw_array_at(const struct cork_raw_array *array, size_t index) +{ + return ((char *) array->items) + (array->priv->element_size * index); +} + +size_t +cork_raw_array_size(const struct cork_raw_array *array) +{ + return array->size; +} + +bool +cork_raw_array_is_empty(const struct cork_raw_array *array) +{ + return (array->size == 0); +} + +void +cork_raw_array_ensure_size(struct cork_raw_array *array, size_t desired_count) +{ + size_t desired_size; + + DEBUG("--- Array %p: Ensure %zu %zu-byte elements", + array, desired_count, array->priv->element_size); + desired_size = desired_count * array->priv->element_size; + + if (desired_size > array->priv->allocated_size) { + size_t new_count = array->priv->allocated_count * 2; + size_t new_size = array->priv->allocated_size * 2; + if (desired_size > new_size) { + new_count = desired_count; + new_size = desired_size; + } + + DEBUG("--- Array %p: Reallocating %zu->%zu bytes", + array, array->priv->allocated_size, new_size); + array->items = cork_realloc(array->items, new_size); + + array->priv->allocated_count = new_count; + array->priv->allocated_size = new_size; + } +} + +void * +cork_raw_array_append(struct cork_raw_array *array) +{ + size_t index; + void *element; + index = array->size++; + cork_raw_array_ensure_size(array, array->size); + element = cork_raw_array_at(array, index); + + /* Call the init or reset callback, depending on whether this entry has been + * initialized before. */ + + /* Since we can currently only add elements by appending them one at a time, + * then this entry is either already initialized, or is the first + * uninitialized entry. */ + assert(index <= array->priv->initialized_count); + + if (index == array->priv->initialized_count) { + /* This element has not been initialized yet. */ + array->priv->initialized_count++; + if (array->priv->init != NULL) { + array->priv->init(array->priv->user_data, element); + } + } else { + /* This element has already been initialized. */ + if (array->priv->reuse != NULL) { + array->priv->reuse(array->priv->user_data, element); + } + } + + return element; +} + +int +cork_raw_array_copy(struct cork_raw_array *dest, + const struct cork_raw_array *src, + cork_copy_f copy, void *user_data) +{ + size_t i; + size_t reuse_count; + char *dest_element; + + DEBUG("--- Copying %zu elements (%zu bytes) from %p to %p", + src->size, src->size * dest->priv->element_size, src, dest); + assert(dest->priv->element_size == src->priv->element_size); + cork_array_clear(dest); + cork_array_ensure_size(dest, src->size); + + /* Initialize enough elements to hold the contents of src */ + reuse_count = dest->priv->initialized_count; + if (src->size < reuse_count) { + reuse_count = src->size; + } + + dest_element = dest->items; + if (dest->priv->reuse != NULL) { + DEBUG(" Calling reuse on elements 0-%zu", reuse_count); + for (i = 0; i < reuse_count; i++) { + dest->priv->reuse(dest->priv->user_data, dest_element); + dest_element += dest->priv->element_size; + } + } else { + dest_element += reuse_count * dest->priv->element_size; + } + + if (dest->priv->init != NULL) { + DEBUG(" Calling init on elements %zu-%zu", reuse_count, src->size); + for (i = reuse_count; i < src->size; i++) { + dest->priv->init(dest->priv->user_data, dest_element); + dest_element += dest->priv->element_size; + } + } + + if (src->size > dest->priv->initialized_count) { + dest->priv->initialized_count = src->size; + } + + /* If the caller provided a copy function, let it copy each element in turn. + * Otherwise, bulk copy everything using memcpy. */ + if (copy == NULL) { + memcpy(dest->items, src->items, src->size * dest->priv->element_size); + } else { + const char *src_element = src->items; + dest_element = dest->items; + for (i = 0; i < src->size; i++) { + rii_check(copy(user_data, dest_element, src_element)); + dest_element += dest->priv->element_size; + src_element += dest->priv->element_size; + } + } + + dest->size = src->size; + return 0; +} + + +/*----------------------------------------------------------------------- + * Pointer arrays + */ + +struct cork_pointer_array { + cork_free_f free; +}; + +static void +pointer__init(void *user_data, void *vvalue) +{ + void **value = vvalue; + *value = NULL; +} + +static void +pointer__done(void *user_data, void *vvalue) +{ + struct cork_pointer_array *ptr_array = user_data; + void **value = vvalue; + if (*value != NULL) { + ptr_array->free(*value); + } +} + +static void +pointer__remove(void *user_data, void *vvalue) +{ + struct cork_pointer_array *ptr_array = user_data; + void **value = vvalue; + if (*value != NULL) { + ptr_array->free(*value); + } + *value = NULL; +} + +void +cork_raw_pointer_array_init(struct cork_raw_array *array, cork_free_f free_ptr) +{ + struct cork_pointer_array *ptr_array = cork_new(struct cork_pointer_array); + ptr_array->free = free_ptr; + cork_raw_array_init(array, sizeof(void *)); + cork_array_set_callback_data(array, ptr_array, free); + cork_array_set_init(array, pointer__init); + cork_array_set_done(array, pointer__done); + cork_array_set_remove(array, pointer__remove); +} + + +/*----------------------------------------------------------------------- + * String arrays + */ + +void +cork_string_array_init(struct cork_string_array *array) +{ + cork_raw_pointer_array_init + ((struct cork_raw_array *) array, (cork_free_f) cork_strfree); +} + +void +cork_string_array_append(struct cork_string_array *array, const char *str) +{ + const char *copy = cork_strdup(str); + cork_array_append(array, copy); +} + +static int +string__copy(void *user_data, void *vdest, const void *vsrc) +{ + const char **dest = vdest; + const char **src = (const char **) vsrc; + *dest = cork_strdup(*src); + return 0; +} + +void +cork_string_array_copy(struct cork_string_array *dest, + const struct cork_string_array *src) +{ + CORK_ATTR_UNUSED int rc; + rc = cork_array_copy(dest, src, string__copy, NULL); + /* cork_array_copy can only fail if the copy callback fails, and ours + * doesn't! */ + assert(rc == 0); +} diff --git a/libcork/ds/bitset.c b/libcork/ds/bitset.c new file mode 100644 index 00000000..66d4e1f1 --- /dev/null +++ b/libcork/ds/bitset.c @@ -0,0 +1,50 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "libcork/core/allocator.h" +#include "libcork/core/api.h" +#include "libcork/core/types.h" +#include "libcork/ds/bitset.h" + + +static size_t +bytes_needed(size_t bit_count) +{ + /* We need one byte for every bit... */ + size_t bytes_needed = bit_count / 8; + /* Plus one extra for the leftovers that don't fit into a whole byte. */ + bytes_needed += ((bit_count % 8) > 0); + return bytes_needed; +} + +struct cork_bitset * +cork_bitset_new(size_t bit_count) +{ + struct cork_bitset *set = cork_new(struct cork_bitset); + set->bit_count = bit_count; + set->byte_count = bytes_needed(bit_count); + set->bits = cork_malloc(set->byte_count); + memset(set->bits, 0, set->byte_count); + return set; +} + +void +cork_bitset_free(struct cork_bitset *set) +{ + free(set->bits); + free(set); +} + +void +cork_bitset_clear(struct cork_bitset *set) +{ + memset(set->bits, 0, set->byte_count); +} diff --git a/libcork/ds/buffer.c b/libcork/ds/buffer.c new file mode 100644 index 00000000..8a3ace3a --- /dev/null +++ b/libcork/ds/buffer.c @@ -0,0 +1,477 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include + +#include "libcork/core/allocator.h" +#include "libcork/core/types.h" +#include "libcork/ds/buffer.h" +#include "libcork/ds/managed-buffer.h" +#include "libcork/ds/stream.h" +#include "libcork/helpers/errors.h" + + +void +cork_buffer_init(struct cork_buffer *buffer) +{ + buffer->buf = NULL; + buffer->size = 0; + buffer->allocated_size = 0; +} + + +struct cork_buffer * +cork_buffer_new(void) +{ + struct cork_buffer *buffer = cork_new(struct cork_buffer); + cork_buffer_init(buffer); + return buffer; +} + + +void +cork_buffer_done(struct cork_buffer *buffer) +{ + if (buffer->buf != NULL) { + free(buffer->buf); + buffer->buf = NULL; + } + buffer->size = 0; + buffer->allocated_size = 0; +} + + +void +cork_buffer_free(struct cork_buffer *buffer) +{ + cork_buffer_done(buffer); + free(buffer); +} + + +bool +cork_buffer_equal(const struct cork_buffer *buffer1, + const struct cork_buffer *buffer2) +{ + if (buffer1 == buffer2) { + return true; + } + + if (buffer1->size != buffer2->size) { + return false; + } + + return (memcmp(buffer1->buf, buffer2->buf, buffer1->size) == 0); +} + + +static void +cork_buffer_ensure_size_int(struct cork_buffer *buffer, size_t desired_size) +{ + size_t new_size; + + if (CORK_LIKELY(buffer->allocated_size >= desired_size)) { + return; + } + + /* Make sure we at least double the old size when reallocating. */ + new_size = buffer->allocated_size * 2; + if (desired_size > new_size) { + new_size = desired_size; + } + + buffer->buf = cork_realloc(buffer->buf, new_size); + buffer->allocated_size = new_size; +} + +void +cork_buffer_ensure_size(struct cork_buffer *buffer, size_t desired_size) +{ + cork_buffer_ensure_size_int(buffer, desired_size); +} + + +void +cork_buffer_clear(struct cork_buffer *buffer) +{ + buffer->size = 0; + if (buffer->buf != NULL) { + ((char *) buffer->buf)[0] = '\0'; + } +} + +void +cork_buffer_truncate(struct cork_buffer *buffer, size_t length) +{ + if (buffer->size > length) { + buffer->size = length; + if (length == 0) { + if (buffer->buf != NULL) { + ((char *) buffer->buf)[0] = '\0'; + } + } else { + ((char *) buffer->buf)[length] = '\0'; + } + } +} + + +void +cork_buffer_set(struct cork_buffer *buffer, const void *src, size_t length) +{ + cork_buffer_ensure_size_int(buffer, length+1); + memcpy(buffer->buf, src, length); + ((char *) buffer->buf)[length] = '\0'; + buffer->size = length; +} + + +void +cork_buffer_append(struct cork_buffer *buffer, const void *src, size_t length) +{ + cork_buffer_ensure_size_int(buffer, buffer->size + length + 1); + memcpy(buffer->buf + buffer->size, src, length); + buffer->size += length; + ((char *) buffer->buf)[buffer->size] = '\0'; +} + + +void +cork_buffer_set_string(struct cork_buffer *buffer, const char *str) +{ + cork_buffer_set(buffer, str, strlen(str)); +} + + +void +cork_buffer_append_string(struct cork_buffer *buffer, const char *str) +{ + cork_buffer_append(buffer, str, strlen(str)); +} + + +void +cork_buffer_append_vprintf(struct cork_buffer *buffer, const char *format, + va_list args) +{ + size_t format_size; + va_list args1; + + va_copy(args1, args); + format_size = vsnprintf(buffer->buf + buffer->size, + buffer->allocated_size - buffer->size, + format, args1); + va_end(args1); + + /* If the first call works, then set buffer->size and return. */ + if (format_size < (buffer->allocated_size - buffer->size)) { + buffer->size += format_size; + return; + } + + /* If the first call fails, resize buffer and try again. */ + cork_buffer_ensure_size_int + (buffer, buffer->allocated_size + format_size + 1); + format_size = vsnprintf(buffer->buf + buffer->size, + buffer->allocated_size - buffer->size, + format, args); + buffer->size += format_size; +} + + +void +cork_buffer_vprintf(struct cork_buffer *buffer, const char *format, + va_list args) +{ + cork_buffer_clear(buffer); + cork_buffer_append_vprintf(buffer, format, args); +} + + +void +cork_buffer_append_printf(struct cork_buffer *buffer, const char *format, ...) +{ + va_list args; + va_start(args, format); + cork_buffer_append_vprintf(buffer, format, args); + va_end(args); +} + + +void +cork_buffer_printf(struct cork_buffer *buffer, const char *format, ...) +{ + va_list args; + va_start(args, format); + cork_buffer_vprintf(buffer, format, args); + va_end(args); +} + + +void +cork_buffer_append_indent(struct cork_buffer *buffer, size_t indent) +{ + cork_buffer_ensure_size_int(buffer, buffer->size + indent + 1); + memset(buffer->buf + buffer->size, ' ', indent); + buffer->size += indent; + ((char *) buffer->buf)[buffer->size] = '\0'; +} + +/* including space */ +#define is_sprint(ch) ((ch) >= 0x20 && (ch) <= 0x7e) + +/* not including space */ +#define is_print(ch) ((ch) > 0x20 && (ch) <= 0x7e) + +#define is_space(ch) \ + ((ch) == ' ' || \ + (ch) == '\f' || \ + (ch) == '\n' || \ + (ch) == '\r' || \ + (ch) == '\t' || \ + (ch) == '\v') + +#define to_hex(nybble) \ + ((nybble) < 10? '0' + (nybble): 'a' - 10 + (nybble)) + +void +cork_buffer_append_c_string(struct cork_buffer *dest, + const char *chars, size_t length) +{ + size_t i; + cork_buffer_append(dest, "\"", 1); + for (i = 0; i < length; i++) { + char ch = chars[i]; + switch (ch) { + case '\"': + cork_buffer_append_literal(dest, "\\\""); + break; + case '\\': + cork_buffer_append_literal(dest, "\\\\"); + break; + case '\f': + cork_buffer_append_literal(dest, "\\f"); + break; + case '\n': + cork_buffer_append_literal(dest, "\\n"); + break; + case '\r': + cork_buffer_append_literal(dest, "\\r"); + break; + case '\t': + cork_buffer_append_literal(dest, "\\t"); + break; + case '\v': + cork_buffer_append_literal(dest, "\\v"); + break; + default: + if (is_sprint(ch)) { + cork_buffer_append(dest, &chars[i], 1); + } else { + uint8_t byte = ch; + cork_buffer_append_printf(dest, "\\x%02" PRIx8, byte); + } + break; + } + } + cork_buffer_append(dest, "\"", 1); +} + +void +cork_buffer_append_hex_dump(struct cork_buffer *dest, size_t indent, + const char *chars, size_t length) +{ + char hex[3 * 16]; + char print[16]; + char *curr_hex = hex; + char *curr_print = print; + size_t i; + size_t column = 0; + for (i = 0; i < length; i++) { + char ch = chars[i]; + uint8_t u8 = ch; + *curr_hex++ = to_hex(u8 >> 4); + *curr_hex++ = to_hex(u8 & 0x0f); + *curr_hex++ = ' '; + *curr_print++ = is_sprint(ch)? ch: '.'; + if (column == 0 && i != 0) { + cork_buffer_append_literal(dest, "\n"); + cork_buffer_append_indent(dest, indent); + column++; + } else if (column == 15) { + cork_buffer_append_printf + (dest, "%-48.*s", (int) (curr_hex - hex), hex); + cork_buffer_append_literal(dest, " |"); + cork_buffer_append(dest, print, curr_print - print); + cork_buffer_append_literal(dest, "|"); + curr_hex = hex; + curr_print = print; + column = 0; + } else { + column++; + } + } + + if (column > 0) { + cork_buffer_append_printf(dest, "%-48.*s", (int) (curr_hex - hex), hex); + cork_buffer_append_literal(dest, " |"); + cork_buffer_append(dest, print, curr_print - print); + cork_buffer_append_literal(dest, "|"); + } +} + +void +cork_buffer_append_multiline(struct cork_buffer *dest, size_t indent, + const char *chars, size_t length) +{ + size_t i; + for (i = 0; i < length; i++) { + char ch = chars[i]; + if (ch == '\n') { + cork_buffer_append_literal(dest, "\n"); + cork_buffer_append_indent(dest, indent); + } else { + cork_buffer_append(dest, &chars[i], 1); + } + } +} + +void +cork_buffer_append_binary(struct cork_buffer *dest, size_t indent, + const char *chars, size_t length) +{ + size_t i; + bool newline = false; + + /* If there are any non-printable characters, print out a hex dump */ + for (i = 0; i < length; i++) { + if (!is_print(chars[i]) && !is_space(chars[i])) { + cork_buffer_append_literal(dest, "(hex)\n"); + cork_buffer_append_indent(dest, indent); + cork_buffer_append_hex_dump(dest, indent, chars, length); + return; + } else if (chars[i] == '\n') { + newline = true; + /* Don't immediately use the multiline format, since there might be + * a non-printable character later on that kicks us over to the hex + * dump format. */ + } + } + + if (newline) { + cork_buffer_append_literal(dest, "(multiline)\n"); + cork_buffer_append_indent(dest, indent); + cork_buffer_append_multiline(dest, indent, chars, length); + } else { + cork_buffer_append(dest, chars, length); + } +} + + +struct cork_buffer__managed_buffer { + struct cork_managed_buffer parent; + struct cork_buffer *buffer; +}; + +static void +cork_buffer__managed_free(struct cork_managed_buffer *vself) +{ + struct cork_buffer__managed_buffer *self = + cork_container_of(vself, struct cork_buffer__managed_buffer, parent); + cork_buffer_free(self->buffer); + free(self); +} + +static struct cork_managed_buffer_iface CORK_BUFFER__MANAGED_BUFFER = { + cork_buffer__managed_free +}; + +struct cork_managed_buffer * +cork_buffer_to_managed_buffer(struct cork_buffer *buffer) +{ + struct cork_buffer__managed_buffer *self = + cork_new(struct cork_buffer__managed_buffer); + self->parent.buf = buffer->buf; + self->parent.size = buffer->size; + self->parent.ref_count = 1; + self->parent.iface = &CORK_BUFFER__MANAGED_BUFFER; + self->buffer = buffer; + return &self->parent; +} + + +int +cork_buffer_to_slice(struct cork_buffer *buffer, struct cork_slice *slice) +{ + struct cork_managed_buffer *managed = + cork_buffer_to_managed_buffer(buffer); + + /* We don't have to check for NULL; cork_managed_buffer_slice_offset + * will do that for us. */ + int rc = cork_managed_buffer_slice_offset(slice, managed, 0); + + /* Before returning, drop our reference to the managed buffer. If + * the slicing succeeded, then there will be one remaining reference + * in the slice. If it didn't succeed, this will free the managed + * buffer for us. */ + cork_managed_buffer_unref(managed); + return rc; +} + + +struct cork_buffer__stream_consumer { + struct cork_stream_consumer consumer; + struct cork_buffer *buffer; +}; + +static int +cork_buffer_stream_consumer_data(struct cork_stream_consumer *consumer, + const void *buf, size_t size, + bool is_first_chunk) +{ + struct cork_buffer__stream_consumer *bconsumer = cork_container_of + (consumer, struct cork_buffer__stream_consumer, consumer); + + if (is_first_chunk) { + cork_buffer_clear(bconsumer->buffer); + } + + cork_buffer_append(bconsumer->buffer, buf, size); + return 0; +} + +static int +cork_buffer_stream_consumer_eof(struct cork_stream_consumer *consumer) +{ + return 0; +} + +static void +cork_buffer_stream_consumer_free(struct cork_stream_consumer *consumer) +{ + struct cork_buffer__stream_consumer *bconsumer = + cork_container_of + (consumer, struct cork_buffer__stream_consumer, consumer); + free(bconsumer); +} + +struct cork_stream_consumer * +cork_buffer_to_stream_consumer(struct cork_buffer *buffer) +{ + struct cork_buffer__stream_consumer *bconsumer = + cork_new(struct cork_buffer__stream_consumer); + bconsumer->consumer.data = cork_buffer_stream_consumer_data; + bconsumer->consumer.eof = cork_buffer_stream_consumer_eof; + bconsumer->consumer.free = cork_buffer_stream_consumer_free; + bconsumer->buffer = buffer; + return &bconsumer->consumer; +} diff --git a/libcork/ds/dllist.c b/libcork/ds/dllist.c new file mode 100644 index 00000000..dbaafbc4 --- /dev/null +++ b/libcork/ds/dllist.c @@ -0,0 +1,63 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2014, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#include "libcork/core/api.h" +#include "libcork/core/types.h" +#include "libcork/ds/dllist.h" + + +/* Include a linkable (but deprecated) version of this to maintain ABI + * compatibility. */ +#undef cork_dllist_init +CORK_API void +cork_dllist_init(struct cork_dllist *list) +{ + list->head.next = &list->head; + list->head.prev = &list->head; +} + + +void +cork_dllist_map(struct cork_dllist *list, + cork_dllist_map_func func, void *user_data) +{ + struct cork_dllist_item *curr; + struct cork_dllist_item *next; + cork_dllist_foreach_void(list, curr, next) { + func(curr, user_data); + } +} + +int +cork_dllist_visit(struct cork_dllist *list, void *ud, + cork_dllist_visit_f *visit) +{ + struct cork_dllist_item *curr; + struct cork_dllist_item *next; + cork_dllist_foreach_void(list, curr, next) { + int rc = visit(ud, curr); + if (rc != 0) { + return rc; + } + } + return 0; +} + + +size_t +cork_dllist_size(const struct cork_dllist *list) +{ + size_t size = 0; + struct cork_dllist_item *curr; + struct cork_dllist_item *next; + cork_dllist_foreach_void(list, curr, next) { + size++; + } + return size; +} diff --git a/libcork/ds/file-stream.c b/libcork/ds/file-stream.c new file mode 100644 index 00000000..70aa399d --- /dev/null +++ b/libcork/ds/file-stream.c @@ -0,0 +1,215 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include +#include +#include + +#include "libcork/ds/stream.h" +#include "libcork/helpers/errors.h" +#include "libcork/helpers/posix.h" + +#define BUFFER_SIZE 4096 + + +/*----------------------------------------------------------------------- + * Producers + */ + +int +cork_consume_fd(struct cork_stream_consumer *consumer, int fd) +{ + char buf[BUFFER_SIZE]; + ssize_t bytes_read; + bool first = true; + + while (true) { + while ((bytes_read = read(fd, buf, BUFFER_SIZE)) > 0) { + rii_check(cork_stream_consumer_data + (consumer, buf, bytes_read, first)); + first = false; + } + + if (bytes_read == 0) { + return cork_stream_consumer_eof(consumer); + } else if (errno != EINTR) { + cork_system_error_set(); + return -1; + } + } +} + +int +cork_consume_file(struct cork_stream_consumer *consumer, FILE *fp) +{ + char buf[BUFFER_SIZE]; + size_t bytes_read; + bool first = true; + + while (true) { + while ((bytes_read = fread(buf, 1, BUFFER_SIZE, fp)) > 0) { + rii_check(cork_stream_consumer_data + (consumer, buf, bytes_read, first)); + first = false; + } + + if (feof(fp)) { + return cork_stream_consumer_eof(consumer); + } else if (errno != EINTR) { + cork_system_error_set(); + return -1; + } + } +} + +int +cork_consume_file_from_path(struct cork_stream_consumer *consumer, + const char *path, int flags) +{ + int fd; + rii_check_posix(fd = open(path, flags)); + ei_check(cork_consume_fd(consumer, fd)); + rii_check_posix(close(fd)); + return 0; + +error: + rii_check_posix(close(fd)); + return -1; +} + + +/*----------------------------------------------------------------------- + * Consumers + */ + +struct cork_file_consumer { + struct cork_stream_consumer parent; + FILE *fp; +}; + +static int +cork_file_consumer__data(struct cork_stream_consumer *vself, + const void *buf, size_t size, bool is_first) +{ + struct cork_file_consumer *self = + cork_container_of(vself, struct cork_file_consumer, parent); + size_t bytes_written = fwrite(buf, 1, size, self->fp); + /* If there was an error writing to the file, then signal this to + * the producer */ + if (bytes_written == size) { + return 0; + } else { + cork_system_error_set(); + return -1; + } +} + +static int +cork_file_consumer__eof(struct cork_stream_consumer *vself) +{ + /* We never close the file with this version of the consumer, so there's + * nothing special to do at end-of-stream. */ + return 0; +} + +static void +cork_file_consumer__free(struct cork_stream_consumer *vself) +{ + struct cork_file_consumer *self = + cork_container_of(vself, struct cork_file_consumer, parent); + free(self); +} + +struct cork_stream_consumer * +cork_file_consumer_new(FILE *fp) +{ + struct cork_file_consumer *self = cork_new(struct cork_file_consumer); + self->parent.data = cork_file_consumer__data; + self->parent.eof = cork_file_consumer__eof; + self->parent.free = cork_file_consumer__free; + self->fp = fp; + return &self->parent; +} + + +struct cork_fd_consumer { + struct cork_stream_consumer parent; + int fd; +}; + +static int +cork_fd_consumer__data(struct cork_stream_consumer *vself, + const void *buf, size_t size, bool is_first) +{ + struct cork_fd_consumer *self = + cork_container_of(vself, struct cork_fd_consumer, parent); + size_t bytes_left = size; + + while (bytes_left > 0) { + ssize_t rc = write(self->fd, buf, bytes_left); + if (rc == -1 && errno != EINTR) { + cork_system_error_set(); + return -1; + } else { + bytes_left -= rc; + buf += rc; + } + } + + return 0; +} + +static int +cork_fd_consumer__eof_close(struct cork_stream_consumer *vself) +{ + int rc; + struct cork_fd_consumer *self = + cork_container_of(vself, struct cork_fd_consumer, parent); + rii_check_posix(rc = close(self->fd)); + return 0; +} + +static void +cork_fd_consumer__free(struct cork_stream_consumer *vself) +{ + struct cork_fd_consumer *self = + cork_container_of(vself, struct cork_fd_consumer, parent); + free(self); +} + +struct cork_stream_consumer * +cork_fd_consumer_new(int fd) +{ + struct cork_fd_consumer *self = cork_new(struct cork_fd_consumer); + self->parent.data = cork_fd_consumer__data; + /* We don't want to close fd, so we reuse file_consumer's eof method */ + self->parent.eof = cork_file_consumer__eof; + self->parent.free = cork_fd_consumer__free; + self->fd = fd; + return &self->parent; +} + +struct cork_stream_consumer * +cork_file_from_path_consumer_new(const char *path, int flags) +{ + + int fd; + struct cork_fd_consumer *self; + + rpi_check_posix(fd = open(path, flags)); + self = cork_new(struct cork_fd_consumer); + self->parent.data = cork_fd_consumer__data; + self->parent.eof = cork_fd_consumer__eof_close; + self->parent.free = cork_fd_consumer__free; + self->fd = fd; + return &self->parent; +} diff --git a/libcork/ds/hash-table.c b/libcork/ds/hash-table.c new file mode 100644 index 00000000..079e6cc8 --- /dev/null +++ b/libcork/ds/hash-table.c @@ -0,0 +1,693 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include + +#include "libcork/core/callbacks.h" +#include "libcork/core/hash.h" +#include "libcork/core/mempool.h" +#include "libcork/core/types.h" +#include "libcork/ds/dllist.h" +#include "libcork/ds/hash-table.h" +#include "libcork/helpers/errors.h" + +#ifndef CORK_HASH_TABLE_DEBUG +#define CORK_HASH_TABLE_DEBUG 0 +#endif + +#if CORK_HASH_TABLE_DEBUG +#include +#define DEBUG(...) \ + do { \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + } while (0) +#else +#define DEBUG(...) /* nothing */ +#endif + + +/*----------------------------------------------------------------------- + * Hash tables + */ + +struct cork_hash_table_entry_priv { + struct cork_hash_table_entry public; + struct cork_dllist_item in_bucket; + struct cork_dllist_item insertion_order; +}; + +struct cork_hash_table { + struct cork_dllist *bins; + struct cork_dllist insertion_order; + size_t bin_count; + size_t bin_mask; + size_t entry_count; + struct cork_mempool *pool; + void *user_data; + cork_free_f free_user_data; + cork_hash_f hash; + cork_equals_f equals; + cork_free_f free_key; + cork_free_f free_value; +}; + +static cork_hash +cork_hash_table__default_hash(void *user_data, const void *key) +{ + return (cork_hash) (uintptr_t) key; +} + +static bool +cork_hash_table__default_equals(void *user_data, + const void *key1, const void *key2) +{ + return key1 == key2; +} + + +/* The default initial number of bins to allocate in a new table. */ +#define CORK_HASH_TABLE_DEFAULT_INITIAL_SIZE 8 + +/* The default number of entries per bin to allow before increasing the + * number of bins. */ +#define CORK_HASH_TABLE_MAX_DENSITY 5 + +/* Return a power-of-2 bin count that's at least as big as the given requested + * size. */ +static inline size_t +cork_hash_table_new_size(size_t desired_count) +{ + size_t v = desired_count; + size_t r = 1; + while (v >>= 1) { + r <<= 1; + } + if (r != desired_count) { + r <<= 1; + } + return r; +} + +#define bin_index(table, hash) ((hash) & (table)->bin_mask) + +/* Allocates a new bins array in a hash table. We overwrite the old + * array, so make sure to stash it away somewhere safe first. */ +static void +cork_hash_table_allocate_bins(struct cork_hash_table *table, + size_t desired_count) +{ + size_t i; + + table->bin_count = cork_hash_table_new_size(desired_count); + table->bin_mask = table->bin_count - 1; + DEBUG("Allocate %zu bins", table->bin_count); + table->bins = cork_calloc(table->bin_count, sizeof(struct cork_dllist)); + for (i = 0; i < table->bin_count; i++) { + cork_dllist_init(&table->bins[i]); + } +} + + +static struct cork_hash_table_entry_priv * +cork_hash_table_new_entry(struct cork_hash_table *table, + cork_hash hash, void *key, void *value) +{ + struct cork_hash_table_entry_priv *entry = + cork_mempool_new_object(table->pool); + cork_dllist_add(&table->insertion_order, &entry->insertion_order); + entry->public.hash = hash; + entry->public.key = key; + entry->public.value = value; + return entry; +} + +static void +cork_hash_table_free_entry(struct cork_hash_table *table, + struct cork_hash_table_entry_priv *entry) +{ + if (table->free_key != NULL) { + table->free_key(entry->public.key); + } + if (table->free_value != NULL) { + table->free_value(entry->public.value); + } + cork_dllist_remove(&entry->insertion_order); + cork_mempool_free_object(table->pool, entry); +} + + +struct cork_hash_table * +cork_hash_table_new(size_t initial_size, unsigned int flags) +{ + struct cork_hash_table *table = cork_new(struct cork_hash_table); + table->entry_count = 0; + table->user_data = NULL; + table->free_user_data = NULL; + table->hash = cork_hash_table__default_hash; + table->equals = cork_hash_table__default_equals; + table->free_key = NULL; + table->free_value = NULL; + table->pool = cork_mempool_new(struct cork_hash_table_entry_priv); + cork_dllist_init(&table->insertion_order); + if (initial_size < CORK_HASH_TABLE_DEFAULT_INITIAL_SIZE) { + initial_size = CORK_HASH_TABLE_DEFAULT_INITIAL_SIZE; + } + cork_hash_table_allocate_bins(table, initial_size); + return table; +} + +void +cork_hash_table_clear(struct cork_hash_table *table) +{ + size_t i; + struct cork_dllist_item *curr; + struct cork_dllist_item *next; + + DEBUG("(clear) Remove all entries"); + for (curr = cork_dllist_start(&table->insertion_order); + !cork_dllist_is_end(&table->insertion_order, curr); + curr = next) { + struct cork_hash_table_entry_priv *entry = + cork_container_of + (curr, struct cork_hash_table_entry_priv, insertion_order); + next = curr->next; + cork_hash_table_free_entry(table, entry); + } + cork_dllist_init(&table->insertion_order); + + DEBUG("(clear) Clear bins"); + for (i = 0; i < table->bin_count; i++) { + DEBUG(" Bin %zu", i); + cork_dllist_init(&table->bins[i]); + } + + table->entry_count = 0; +} + +void +cork_hash_table_free(struct cork_hash_table *table) +{ + cork_hash_table_clear(table); + cork_mempool_free(table->pool); + free(table->bins); + free(table); +} + +size_t +cork_hash_table_size(const struct cork_hash_table *table) +{ + return table->entry_count; +} + +void +cork_hash_table_set_user_data(struct cork_hash_table *table, + void *user_data, cork_free_f free_user_data) +{ + table->user_data = user_data; + table->free_user_data = free_user_data; +} + +void +cork_hash_table_set_hash(struct cork_hash_table *table, cork_hash_f hash) +{ + table->hash = hash; +} + +void +cork_hash_table_set_equals(struct cork_hash_table *table, cork_equals_f equals) +{ + table->equals = equals; +} + +void +cork_hash_table_set_free_key(struct cork_hash_table *table, cork_free_f free) +{ + table->free_key = free; +} + +void +cork_hash_table_set_free_value(struct cork_hash_table *table, cork_free_f free) +{ + table->free_value = free; +} + + +void +cork_hash_table_ensure_size(struct cork_hash_table *table, size_t desired_count) +{ + if (desired_count > table->bin_count) { + struct cork_dllist *old_bins = table->bins; + size_t old_bin_count = table->bin_count; + + cork_hash_table_allocate_bins(table, desired_count); + + if (old_bins != NULL) { + size_t i; + for (i = 0; i < old_bin_count; i++) { + struct cork_dllist *bin = &old_bins[i]; + struct cork_dllist_item *curr = cork_dllist_start(bin); + while (!cork_dllist_is_end(bin, curr)) { + struct cork_hash_table_entry_priv *entry = + cork_container_of + (curr, struct cork_hash_table_entry_priv, in_bucket); + struct cork_dllist_item *next = curr->next; + + size_t bin_index = bin_index(table, entry->public.hash); + DEBUG(" Rehash %p from bin %zu to bin %zu", + entry, i, bin_index); + cork_dllist_add(&table->bins[bin_index], curr); + + curr = next; + } + } + + free(old_bins); + } + } +} + + +static void +cork_hash_table_rehash(struct cork_hash_table *table) +{ + DEBUG(" Reached maximum density; rehash"); + cork_hash_table_ensure_size(table, table->bin_count + 1); +} + + +struct cork_hash_table_entry * +cork_hash_table_get_entry_hash(const struct cork_hash_table *table, + cork_hash hash, const void *key) +{ + size_t bin_index; + struct cork_dllist *bin; + struct cork_dllist_item *curr; + + if (table->bin_count == 0) { + DEBUG("(get) Empty table when searching for key %p " + "(hash 0x%08" PRIx32 ")", + key, hash); + return NULL; + } + + bin_index = bin_index(table, hash); + DEBUG("(get) Search for key %p (hash 0x%08" PRIx32 ", bin %zu)", + key, hash, bin_index); + + bin = &table->bins[bin_index]; + curr = cork_dllist_start(bin); + while (!cork_dllist_is_end(bin, curr)) { + struct cork_hash_table_entry_priv *entry = + cork_container_of + (curr, struct cork_hash_table_entry_priv, in_bucket); + + DEBUG(" Check entry %p", entry); + if (table->equals(table->user_data, key, entry->public.key)) { + DEBUG(" Match"); + return &entry->public; + } + + curr = curr->next; + } + + DEBUG(" Entry not found"); + return NULL; +} + +struct cork_hash_table_entry * +cork_hash_table_get_entry(const struct cork_hash_table *table, const void *key) +{ + cork_hash hash = table->hash(table->user_data, key); + return cork_hash_table_get_entry_hash(table, hash, key); +} + +void * +cork_hash_table_get_hash(const struct cork_hash_table *table, + cork_hash hash, const void *key) +{ + struct cork_hash_table_entry *entry = + cork_hash_table_get_entry_hash(table, hash, key); + if (entry == NULL) { + return NULL; + } else { + DEBUG(" Extract value pointer %p", entry->value); + return entry->value; + } +} + +void * +cork_hash_table_get(const struct cork_hash_table *table, const void *key) +{ + struct cork_hash_table_entry *entry = + cork_hash_table_get_entry(table, key); + if (entry == NULL) { + return NULL; + } else { + DEBUG(" Extract value pointer %p", entry->value); + return entry->value; + } +} + + +struct cork_hash_table_entry * +cork_hash_table_get_or_create_hash(struct cork_hash_table *table, + cork_hash hash, void *key, bool *is_new) +{ + struct cork_hash_table_entry_priv *entry; + size_t bin_index; + + if (table->bin_count > 0) { + struct cork_dllist *bin; + struct cork_dllist_item *curr; + + bin_index = bin_index(table, hash); + DEBUG("(get_or_create) Search for key %p " + "(hash 0x%08" PRIx32 ", bin %zu)", + key, hash, bin_index); + + bin = &table->bins[bin_index]; + curr = cork_dllist_start(bin); + while (!cork_dllist_is_end(bin, curr)) { + struct cork_hash_table_entry_priv *entry = + cork_container_of + (curr, struct cork_hash_table_entry_priv, in_bucket); + + DEBUG(" Check entry %p", entry); + if (table->equals(table->user_data, key, entry->public.key)) { + DEBUG(" Match"); + DEBUG(" Return value pointer %p", entry->public.value); + *is_new = false; + return &entry->public; + } + + curr = curr->next; + } + + /* create a new entry */ + DEBUG(" Entry not found"); + + if ((table->entry_count / table->bin_count) > + CORK_HASH_TABLE_MAX_DENSITY) { + cork_hash_table_rehash(table); + bin_index = bin_index(table, hash); + } + } else { + DEBUG("(get_or_create) Search for key %p (hash 0x%08" PRIx32 ")", + key, hash); + DEBUG(" Empty table"); + cork_hash_table_rehash(table); + bin_index = bin_index(table, hash); + } + + DEBUG(" Allocate new entry"); + entry = cork_hash_table_new_entry(table, hash, key, NULL); + DEBUG(" Created new entry %p", entry); + + DEBUG(" Add entry into bin %zu", bin_index); + cork_dllist_add(&table->bins[bin_index], &entry->in_bucket); + + table->entry_count++; + *is_new = true; + return &entry->public; +} + +struct cork_hash_table_entry * +cork_hash_table_get_or_create(struct cork_hash_table *table, + void *key, bool *is_new) +{ + cork_hash hash = table->hash(table->user_data, key); + return cork_hash_table_get_or_create_hash(table, hash, key, is_new); +} + + +void +cork_hash_table_put_hash(struct cork_hash_table *table, + cork_hash hash, void *key, void *value, + bool *is_new, void **old_key, void **old_value) +{ + struct cork_hash_table_entry_priv *entry; + size_t bin_index; + + if (table->bin_count > 0) { + struct cork_dllist *bin; + struct cork_dllist_item *curr; + + bin_index = bin_index(table, hash); + DEBUG("(put) Search for key %p (hash 0x%08" PRIx32 ", bin %zu)", + key, hash, bin_index); + + bin = &table->bins[bin_index]; + curr = cork_dllist_start(bin); + while (!cork_dllist_is_end(bin, curr)) { + struct cork_hash_table_entry_priv *entry = + cork_container_of + (curr, struct cork_hash_table_entry_priv, in_bucket); + + DEBUG(" Check entry %p", entry); + if (table->equals(table->user_data, key, entry->public.key)) { + DEBUG(" Found existing entry; overwriting"); + DEBUG(" Return old key %p", entry->public.key); + if (old_key != NULL) { + *old_key = entry->public.key; + } + DEBUG(" Return old value %p", entry->public.value); + if (old_value != NULL) { + *old_value = entry->public.value; + } + DEBUG(" Copy key %p into entry", key); + entry->public.key = key; + DEBUG(" Copy value %p into entry", value); + entry->public.value = value; + if (is_new != NULL) { + *is_new = false; + } + return; + } + + curr = curr->next; + } + + /* create a new entry */ + DEBUG(" Entry not found"); + if ((table->entry_count / table->bin_count) > + CORK_HASH_TABLE_MAX_DENSITY) { + cork_hash_table_rehash(table); + bin_index = bin_index(table, hash); + } + } else { + DEBUG("(put) Search for key %p (hash 0x%08" PRIx32 ")", + key, hash); + DEBUG(" Empty table"); + cork_hash_table_rehash(table); + bin_index = bin_index(table, hash); + } + + DEBUG(" Allocate new entry"); + entry = cork_hash_table_new_entry(table, hash, key, value); + DEBUG(" Created new entry %p", entry); + + DEBUG(" Add entry into bin %zu", bin_index); + cork_dllist_add(&table->bins[bin_index], &entry->in_bucket); + + table->entry_count++; + if (old_key != NULL) { + *old_key = NULL; + } + if (old_value != NULL) { + *old_value = NULL; + } + if (is_new != NULL) { + *is_new = true; + } +} + +void +cork_hash_table_put(struct cork_hash_table *table, + void *key, void *value, + bool *is_new, void **old_key, void **old_value) +{ + cork_hash hash = table->hash(table->user_data, key); + cork_hash_table_put_hash + (table, hash, key, value, is_new, old_key, old_value); +} + + +void +cork_hash_table_delete_entry(struct cork_hash_table *table, + struct cork_hash_table_entry *ventry) +{ + struct cork_hash_table_entry_priv *entry = + cork_container_of(ventry, struct cork_hash_table_entry_priv, public); + cork_dllist_remove(&entry->in_bucket); + table->entry_count--; + cork_hash_table_free_entry(table, entry); +} + + +bool +cork_hash_table_delete_hash(struct cork_hash_table *table, + cork_hash hash, const void *key, + void **deleted_key, void **deleted_value) +{ + size_t bin_index; + struct cork_dllist *bin; + struct cork_dllist_item *curr; + + if (table->bin_count == 0) { + DEBUG("(delete) Empty table when searching for key %p " + "(hash 0x%08" PRIx32 ")", + key, hash); + return false; + } + + bin_index = bin_index(table, hash); + DEBUG("(delete) Search for key %p (hash 0x%08" PRIx32 ", bin %zu)", + key, hash, bin_index); + + bin = &table->bins[bin_index]; + curr = cork_dllist_start(bin); + while (!cork_dllist_is_end(bin, curr)) { + struct cork_hash_table_entry_priv *entry = + cork_container_of + (curr, struct cork_hash_table_entry_priv, in_bucket); + + DEBUG(" Check entry %p", entry); + if (table->equals(table->user_data, key, entry->public.key)) { + DEBUG(" Match"); + if (deleted_key != NULL) { + *deleted_key = entry->public.key; + } + if (deleted_value != NULL) { + *deleted_value = entry->public.value; + } + + DEBUG(" Remove entry from hash bin %zu", bin_index); + cork_dllist_remove(curr); + table->entry_count--; + + DEBUG(" Free entry %p", entry); + cork_hash_table_free_entry(table, entry); + return true; + } + + curr = curr->next; + } + + DEBUG(" Entry not found"); + return false; +} + +bool +cork_hash_table_delete(struct cork_hash_table *table, const void *key, + void **deleted_key, void **deleted_value) +{ + cork_hash hash = table->hash(table->user_data, key); + return cork_hash_table_delete_hash + (table, hash, key, deleted_key, deleted_value); +} + + +void +cork_hash_table_map(struct cork_hash_table *table, void *user_data, + cork_hash_table_map_f map) +{ + struct cork_dllist_item *curr; + DEBUG("Map across hash table"); + + curr = cork_dllist_start(&table->insertion_order); + while (!cork_dllist_is_end(&table->insertion_order, curr)) { + struct cork_hash_table_entry_priv *entry = + cork_container_of + (curr, struct cork_hash_table_entry_priv, insertion_order); + struct cork_dllist_item *next = curr->next; + enum cork_hash_table_map_result result; + + DEBUG(" Apply function to entry %p", entry); + result = map(user_data, &entry->public); + + if (result == CORK_HASH_TABLE_MAP_ABORT) { + return; + } else if (result == CORK_HASH_TABLE_MAP_DELETE) { + DEBUG(" Delete requested"); + cork_dllist_remove(curr); + table->entry_count--; + cork_hash_table_free_entry(table, entry); + } + + curr = next; + } +} + + +void +cork_hash_table_iterator_init(struct cork_hash_table *table, + struct cork_hash_table_iterator *iterator) +{ + DEBUG("Iterate through hash table"); + iterator->table = table; + iterator->priv = cork_dllist_start(&table->insertion_order); +} + + +struct cork_hash_table_entry * +cork_hash_table_iterator_next(struct cork_hash_table_iterator *iterator) +{ + struct cork_hash_table *table = iterator->table; + struct cork_dllist_item *curr = iterator->priv; + struct cork_hash_table_entry_priv *entry; + + if (cork_dllist_is_end(&table->insertion_order, curr)) { + return NULL; + } + + entry = cork_container_of + (curr, struct cork_hash_table_entry_priv, insertion_order); + DEBUG(" Return entry %p", entry); + iterator->priv = curr->next; + return &entry->public; +} + + +/*----------------------------------------------------------------------- + * Built-in key types + */ + +static cork_hash +string_hash(void *user_data, const void *vk) +{ + const char *k = vk; + size_t len = strlen(k); + return cork_hash_buffer(0, k, len); +} + +static bool +string_equals(void *user_data, const void *vk1, const void *vk2) +{ + const char *k1 = vk1; + const char *k2 = vk2; + return strcmp(k1, k2) == 0; +} + +struct cork_hash_table * +cork_string_hash_table_new(size_t initial_size, unsigned int flags) +{ + struct cork_hash_table *table = cork_hash_table_new(initial_size, flags); + cork_hash_table_set_hash(table, string_hash); + cork_hash_table_set_equals(table, string_equals); + return table; +} + +struct cork_hash_table * +cork_pointer_hash_table_new(size_t initial_size, unsigned int flags) +{ + return cork_hash_table_new(initial_size, flags); +} diff --git a/libcork/ds/managed-buffer.c b/libcork/ds/managed-buffer.c new file mode 100644 index 00000000..6fdbe448 --- /dev/null +++ b/libcork/ds/managed-buffer.c @@ -0,0 +1,239 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include + +#include "libcork/core/error.h" +#include "libcork/core/types.h" +#include "libcork/ds/managed-buffer.h" +#include "libcork/ds/slice.h" +#include "libcork/helpers/errors.h" + + +/*----------------------------------------------------------------------- + * Error handling + */ + +static void +cork_slice_invalid_slice_set(size_t buf_size, size_t requested_offset, + size_t requested_length) +{ + cork_error_set + (CORK_SLICE_ERROR, CORK_SLICE_INVALID_SLICE, + "Cannot slice %zu-byte buffer at %zu:%zu", + buf_size, requested_offset, requested_length); +} + + +/*----------------------------------------------------------------------- + * Managed buffers + */ + +struct cork_managed_buffer_wrapped { + struct cork_managed_buffer parent; + void *buf; + size_t size; + cork_managed_buffer_freer free; +}; + +static void +cork_managed_buffer_wrapped__free(struct cork_managed_buffer *vself) +{ + struct cork_managed_buffer_wrapped *self = + cork_container_of(vself, struct cork_managed_buffer_wrapped, parent); + self->free(self->buf, self->size); + free(self); +} + +static struct cork_managed_buffer_iface CORK_MANAGED_BUFFER_WRAPPED = { + cork_managed_buffer_wrapped__free +}; + +struct cork_managed_buffer * +cork_managed_buffer_new(const void *buf, size_t size, + cork_managed_buffer_freer free) +{ + /* + DEBUG("Creating new struct cork_managed_buffer [%p:%zu], refcount now 1", + buf, size); + */ + + struct cork_managed_buffer_wrapped *self = + cork_new(struct cork_managed_buffer_wrapped); + self->parent.buf = buf; + self->parent.size = size; + self->parent.ref_count = 1; + self->parent.iface = &CORK_MANAGED_BUFFER_WRAPPED; + self->buf = (void *) buf; + self->size = size; + self->free = free; + return &self->parent; +} + + +struct cork_managed_buffer_copied { + struct cork_managed_buffer parent; +}; + +#define cork_managed_buffer_copied_data(self) \ + (((void *) (self)) + sizeof(struct cork_managed_buffer_copied)) + +#define cork_managed_buffer_copied_sizeof(sz) \ + ((sz) + sizeof(struct cork_managed_buffer_copied)) + +static void +cork_managed_buffer_copied__free(struct cork_managed_buffer *vself) +{ + struct cork_managed_buffer_copied *self = + cork_container_of(vself, struct cork_managed_buffer_copied, parent); + free(self); +} + +static struct cork_managed_buffer_iface CORK_MANAGED_BUFFER_COPIED = { + cork_managed_buffer_copied__free +}; + +struct cork_managed_buffer * +cork_managed_buffer_new_copy(const void *buf, size_t size) +{ + size_t allocated_size = cork_managed_buffer_copied_sizeof(size); + struct cork_managed_buffer_copied *self = malloc(allocated_size); + if (self == NULL) { + return NULL; + } + + self->parent.buf = cork_managed_buffer_copied_data(self); + self->parent.size = size; + self->parent.ref_count = 1; + self->parent.iface = &CORK_MANAGED_BUFFER_COPIED; + memcpy((void *) self->parent.buf, buf, size); + return &self->parent; +} + + +static void +cork_managed_buffer_free(struct cork_managed_buffer *self) +{ + /* + DEBUG("Freeing struct cork_managed_buffer [%p:%zu]", self->buf, self->size); + */ + + self->iface->free(self); +} + + +struct cork_managed_buffer * +cork_managed_buffer_ref(struct cork_managed_buffer *self) +{ + /* + int old_count = self->ref_count++; + DEBUG("Referencing struct cork_managed_buffer [%p:%zu], refcount now %d", + self->buf, self->size, old_count + 1); + */ + + self->ref_count++; + return self; +} + + +void +cork_managed_buffer_unref(struct cork_managed_buffer *self) +{ + /* + int old_count = self->ref_count--; + DEBUG("Dereferencing struct cork_managed_buffer [%p:%zu], refcount now %d", + self->buf, self->size, old_count - 1); + */ + + if (--self->ref_count == 0) { + cork_managed_buffer_free(self); + } +} + + +static struct cork_slice_iface CORK_MANAGED_BUFFER__SLICE; + +static void +cork_managed_buffer__slice_free(struct cork_slice *self) +{ + struct cork_managed_buffer *mbuf = self->user_data; + cork_managed_buffer_unref(mbuf); +} + +static int +cork_managed_buffer__slice_copy(struct cork_slice *dest, + const struct cork_slice *src, + size_t offset, size_t length) +{ + struct cork_managed_buffer *mbuf = src->user_data; + dest->buf = src->buf + offset; + dest->size = length; + dest->iface = &CORK_MANAGED_BUFFER__SLICE; + dest->user_data = cork_managed_buffer_ref(mbuf); + return 0; +} + +static struct cork_slice_iface CORK_MANAGED_BUFFER__SLICE = { + cork_managed_buffer__slice_free, + cork_managed_buffer__slice_copy, + cork_managed_buffer__slice_copy, + NULL +}; + + +int +cork_managed_buffer_slice(struct cork_slice *dest, + struct cork_managed_buffer *buffer, + size_t offset, size_t length) +{ + if ((buffer != NULL) && + (offset <= buffer->size) && + ((offset + length) <= buffer->size)) { + /* + DEBUG("Slicing [%p:%zu] at %zu:%zu, gives <%p:%zu>", + buffer->buf, buffer->size, + offset, length, + buffer->buf + offset, length); + */ + dest->buf = buffer->buf + offset; + dest->size = length; + dest->iface = &CORK_MANAGED_BUFFER__SLICE; + dest->user_data = cork_managed_buffer_ref(buffer); + return 0; + } + + else { + /* + DEBUG("Cannot slice [%p:%zu] at %zu:%zu", + buffer->buf, buffer->size, + offset, length); + */ + cork_slice_clear(dest); + cork_slice_invalid_slice_set(0, offset, 0); + return -1; + } +} + + +int +cork_managed_buffer_slice_offset(struct cork_slice *dest, + struct cork_managed_buffer *buffer, + size_t offset) +{ + if (buffer == NULL) { + cork_slice_clear(dest); + cork_slice_invalid_slice_set(0, offset, 0); + return -1; + } else { + return cork_managed_buffer_slice + (dest, buffer, offset, buffer->size - offset); + } +} diff --git a/libcork/ds/ring-buffer.c b/libcork/ds/ring-buffer.c new file mode 100644 index 00000000..62c2cf0b --- /dev/null +++ b/libcork/ds/ring-buffer.c @@ -0,0 +1,88 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "libcork/core/allocator.h" +#include "libcork/core/types.h" +#include "libcork/ds/ring-buffer.h" + + +int +cork_ring_buffer_init(struct cork_ring_buffer *self, size_t size) +{ + self->elements = cork_calloc(size, sizeof(void *)); + self->allocated_size = size; + self->size = 0; + self->read_index = 0; + self->write_index = 0; + return 0; +} + +struct cork_ring_buffer * +cork_ring_buffer_new(size_t size) +{ + struct cork_ring_buffer *buf = cork_new(struct cork_ring_buffer); + cork_ring_buffer_init(buf, size); + return buf; +} + +void +cork_ring_buffer_done(struct cork_ring_buffer *self) +{ + free(self->elements); +} + +void +cork_ring_buffer_free(struct cork_ring_buffer *buf) +{ + cork_ring_buffer_done(buf); + free(buf); +} + +int +cork_ring_buffer_add(struct cork_ring_buffer *self, void *element) +{ + if (cork_ring_buffer_is_full(self)) { + return -1; + } + + self->elements[self->write_index++] = element; + self->size++; + if (self->write_index == self->allocated_size) { + self->write_index = 0; + } + return 0; +} + +void * +cork_ring_buffer_pop(struct cork_ring_buffer *self) +{ + if (cork_ring_buffer_is_empty(self)) { + return NULL; + } else { + void *result = self->elements[self->read_index++]; + self->size--; + if (self->read_index == self->allocated_size) { + self->read_index = 0; + } + return result; + } +} + +void * +cork_ring_buffer_peek(struct cork_ring_buffer *self) +{ + if (cork_ring_buffer_is_empty(self)) { + return NULL; + } else { + return self->elements[self->read_index]; + } +} diff --git a/libcork/ds/slice.c b/libcork/ds/slice.c new file mode 100644 index 00000000..68de06c8 --- /dev/null +++ b/libcork/ds/slice.c @@ -0,0 +1,296 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "libcork/core/error.h" +#include "libcork/core/types.h" +#include "libcork/ds/managed-buffer.h" +#include "libcork/ds/slice.h" +#include "libcork/helpers/errors.h" + + +/*----------------------------------------------------------------------- + * Error handling + */ + +static void +cork_slice_invalid_slice_set(size_t buf_size, size_t requested_offset, + size_t requested_length) +{ + cork_error_set + (CORK_SLICE_ERROR, CORK_SLICE_INVALID_SLICE, + "Cannot slice %zu-byte buffer at %zu:%zu", + buf_size, requested_offset, requested_length); +} + + +/*----------------------------------------------------------------------- + * Slices + */ + +void +cork_slice_clear(struct cork_slice *slice) +{ + slice->buf = NULL; + slice->size = 0; + slice->iface = NULL; + slice->user_data = NULL; +} + + +int +cork_slice_copy(struct cork_slice *dest, const struct cork_slice *slice, + size_t offset, size_t length) +{ + if ((slice != NULL) && + (offset <= slice->size) && + ((offset + length) <= slice->size)) { + /* + DEBUG("Slicing <%p:%zu> at %zu:%zu, gives <%p:%zu>", + slice->buf, slice->size, + offset, length, + slice->buf + offset, length); + */ + return slice->iface->copy(dest, slice, offset, length); + } + + else { + /* + DEBUG("Cannot slice <%p:%zu> at %zu:%zu", + slice->buf, slice->size, + offset, length); + */ + cork_slice_clear(dest); + cork_slice_invalid_slice_set + ((slice == NULL)? 0: slice->size, offset, length); + return -1; + } +} + + +int +cork_slice_copy_offset(struct cork_slice *dest, const struct cork_slice *slice, + size_t offset) +{ + if (slice == NULL) { + cork_slice_clear(dest); + cork_slice_invalid_slice_set(0, offset, 0); + return -1; + } else { + return cork_slice_copy + (dest, slice, offset, slice->size - offset); + } +} + + +int +cork_slice_light_copy(struct cork_slice *dest, const struct cork_slice *slice, + size_t offset, size_t length) +{ + if ((slice != NULL) && + (offset <= slice->size) && + ((offset + length) <= slice->size)) { + /* + DEBUG("Slicing <%p:%zu> at %zu:%zu, gives <%p:%zu>", + slice->buf, slice->size, + offset, length, + slice->buf + offset, length); + */ + return slice->iface->light_copy(dest, slice, offset, length); + } + + else { + /* + DEBUG("Cannot slice <%p:%zu> at %zu:%zu", + slice->buf, slice->size, + offset, length); + */ + cork_slice_clear(dest); + cork_slice_invalid_slice_set + ((slice == NULL)? 0: slice->size, offset, length); + return -1; + } +} + + +int +cork_slice_light_copy_offset(struct cork_slice *dest, + const struct cork_slice *slice, size_t offset) +{ + if (slice == NULL) { + cork_slice_clear(dest); + cork_slice_invalid_slice_set(0, offset, 0); + return -1; + } else { + return cork_slice_light_copy + (dest, slice, offset, slice->size - offset); + } +} + + +int +cork_slice_slice(struct cork_slice *slice, size_t offset, size_t length) +{ + if ((slice != NULL) && + (offset <= slice->size) && + ((offset + length) <= slice->size)) { + /* + DEBUG("Slicing <%p:%zu> at %zu:%zu, gives <%p:%zu>", + slice->buf, slice->size, + offset, length, + slice->buf + offset, length); + */ + if (slice->iface->slice == NULL) { + slice->buf += offset; + slice->size = length; + return 0; + } else { + return slice->iface->slice(slice, offset, length); + } + } + + else { + /* + DEBUG("Cannot slice <%p:%zu> at %zu:%zu", + slice->buf, slice->size, + offset, length); + */ + cork_slice_invalid_slice_set(slice->size, offset, length); + return -1; + } +} + + +int +cork_slice_slice_offset(struct cork_slice *slice, size_t offset) +{ + if (slice == NULL) { + cork_slice_invalid_slice_set(0, offset, 0); + return -1; + } else { + return cork_slice_slice + (slice, offset, slice->size - offset); + } +} + + +void +cork_slice_finish(struct cork_slice *slice) +{ + /* + DEBUG("Finalizing <%p:%zu>", dest->buf, dest->size); + */ + + if (slice->iface != NULL && slice->iface->free != NULL) { + slice->iface->free(slice); + } + + cork_slice_clear(slice); +} + + +bool +cork_slice_equal(const struct cork_slice *slice1, + const struct cork_slice *slice2) +{ + if (slice1 == slice2) { + return true; + } + + if (slice1->size != slice2->size) { + return false; + } + + return (memcmp(slice1->buf, slice2->buf, slice1->size) == 0); +} + + +/*----------------------------------------------------------------------- + * Slices of static content + */ + +static struct cork_slice_iface cork_static_slice; + +static int +cork_static_slice_copy(struct cork_slice *dest, const struct cork_slice *src, + size_t offset, size_t length) +{ + dest->buf = src->buf + offset; + dest->size = length; + dest->iface = &cork_static_slice; + dest->user_data = NULL; + return 0; +} + +static struct cork_slice_iface cork_static_slice = { + NULL, + cork_static_slice_copy, + cork_static_slice_copy, + NULL +}; + +void +cork_slice_init_static(struct cork_slice *dest, const void *buf, size_t size) +{ + dest->buf = buf; + dest->size = size; + dest->iface = &cork_static_slice; + dest->user_data = NULL; +} + + +/*----------------------------------------------------------------------- + * Copy-once slices + */ + +static struct cork_slice_iface cork_copy_once_slice; + +static int +cork_copy_once_slice__copy(struct cork_slice *dest, + const struct cork_slice *src, + size_t offset, size_t length) +{ + struct cork_managed_buffer *mbuf = + cork_managed_buffer_new_copy(src->buf, src->size); + rii_check(cork_managed_buffer_slice(dest, mbuf, offset, length)); + rii_check(cork_managed_buffer_slice + ((struct cork_slice *) src, mbuf, 0, src->size)); + cork_managed_buffer_unref(mbuf); + return 0; +} + +static int +cork_copy_once_slice__light_copy(struct cork_slice *dest, + const struct cork_slice *src, + size_t offset, size_t length) +{ + dest->buf = src->buf + offset; + dest->size = length; + dest->iface = &cork_copy_once_slice; + dest->user_data = NULL; + return 0; +} + +static struct cork_slice_iface cork_copy_once_slice = { + NULL, + cork_copy_once_slice__copy, + cork_copy_once_slice__light_copy, + NULL +}; + +void +cork_slice_init_copy_once(struct cork_slice *dest, const void *buf, size_t size) +{ + dest->buf = buf; + dest->size = size; + dest->iface = &cork_copy_once_slice; + dest->user_data = NULL; +} diff --git a/libcork/include/libcork/cli.h b/libcork/include/libcork/cli.h new file mode 100644 index 00000000..b5d20c1f --- /dev/null +++ b/libcork/include/libcork/cli.h @@ -0,0 +1,18 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CLI_H +#define LIBCORK_CLI_H + +/*** include all of the parts ***/ + +#include + +#endif /* LIBCORK_CLI_H */ diff --git a/libcork/include/libcork/cli/commands.h b/libcork/include/libcork/cli/commands.h new file mode 100644 index 00000000..1569a741 --- /dev/null +++ b/libcork/include/libcork/cli/commands.h @@ -0,0 +1,61 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_COMMANDS_H +#define LIBCORK_COMMANDS_H + +#include + + +typedef void +(*cork_leaf_command_run)(int argc, char **argv); + +typedef int +(*cork_option_parser)(int argc, char **argv); + +enum cork_command_type { + CORK_COMMAND_SET, + CORK_LEAF_COMMAND +}; + +struct cork_command { + enum cork_command_type type; + const char *name; + const char *short_desc; + const char *usage_suffix; + const char *full_help; + + int + (*parse_options)(int argc, char **argv); + + struct cork_command **set; + cork_leaf_command_run run; +}; + +#define cork_command_set(name, sd, parse_options, set) \ +{ \ + CORK_COMMAND_SET, name, sd, NULL, NULL, \ + parse_options, set, NULL \ +} + +#define cork_leaf_command(name, sd, us, fh, parse_options, run) \ +{ \ + CORK_LEAF_COMMAND, name, sd, us, fh, \ + parse_options, NULL, run \ +} + +CORK_API void +cork_command_show_help(struct cork_command *command, const char *message); + +CORK_API int +cork_command_main(struct cork_command *root, int argc, char **argv); + + +#endif /* LIBCORK_COMMANDS_H */ diff --git a/libcork/include/libcork/config/arch.h b/libcork/include/libcork/config/arch.h new file mode 100644 index 00000000..eaed9916 --- /dev/null +++ b/libcork/include/libcork/config/arch.h @@ -0,0 +1,45 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CONFIG_ARCH_H +#define LIBCORK_CONFIG_ARCH_H + + +/*----------------------------------------------------------------------- + * Platform + */ + +#if defined(__i386__) || defined(_M_IX86) +#define CORK_CONFIG_ARCH_X86 1 +#else +#define CORK_CONFIG_ARCH_X86 0 +#endif + +#if defined(__x86_64__) || defined(_M_X64) +#define CORK_CONFIG_ARCH_X64 1 +#else +#define CORK_CONFIG_ARCH_X64 0 +#endif + +#if defined(__powerpc__) || defined(__ppc__) +/* GCC-ish compiler */ +#define CORK_CONFIG_ARCH_PPC 1 +#elif defined(_M_PPC) +/* VS-ish compiler */ +#define CORK_CONFIG_ARCH_PPC 1 +#elif defined(_ARCH_PPC) +/* Something called XL C/C++? */ +#define CORK_CONFIG_ARCH_PPC 1 +#else +#define CORK_CONFIG_ARCH_PPC 0 +#endif + + +#endif /* LIBCORK_CONFIG_ARCH_H */ diff --git a/libcork/include/libcork/config/bsd.h b/libcork/include/libcork/config/bsd.h new file mode 100644 index 00000000..4c89c074 --- /dev/null +++ b/libcork/include/libcork/config/bsd.h @@ -0,0 +1,34 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CONFIG_BSD_H +#define LIBCORK_CONFIG_BSD_H + +/*----------------------------------------------------------------------- + * Endianness + */ + +#include + +#if BYTE_ORDER == BIG_ENDIAN +#define CORK_CONFIG_IS_BIG_ENDIAN 1 +#define CORK_CONFIG_IS_LITTLE_ENDIAN 0 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define CORK_CONFIG_IS_BIG_ENDIAN 0 +#define CORK_CONFIG_IS_LITTLE_ENDIAN 1 +#else +#error "Cannot determine system endianness" +#endif + +#define CORK_HAVE_REALLOCF 1 +#define CORK_HAVE_PTHREADS 1 + + +#endif /* LIBCORK_CONFIG_BSD_H */ diff --git a/libcork/include/libcork/config/gcc.h b/libcork/include/libcork/config/gcc.h new file mode 100644 index 00000000..d7bbffac --- /dev/null +++ b/libcork/include/libcork/config/gcc.h @@ -0,0 +1,91 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CONFIG_GCC_H +#define LIBCORK_CONFIG_GCC_H + +/* Figure out the GCC version */ + +#if defined(__GNUC_PATCHLEVEL__) +#define CORK_CONFIG_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#else +#define CORK_CONFIG_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100) +#endif + + +/*----------------------------------------------------------------------- + * Compiler attributes + */ + +/* The GCC assembly syntax has been available basically forever. */ + +#if defined(CORK_CONFIG_GCC_VERSION) +#define CORK_CONFIG_HAVE_GCC_ASM 1 +#else +#define CORK_CONFIG_HAVE_GCC_ASM 0 +#endif + +/* The GCC atomic instrinsics are available as of GCC 4.1.0. */ + +#if CORK_CONFIG_GCC_VERSION >= 40100 +#define CORK_CONFIG_HAVE_GCC_ATOMICS 1 +#else +#define CORK_CONFIG_HAVE_GCC_ATOMICS 0 +#endif + +/* The attributes we want to use are available as of GCC 2.96. */ + +#if CORK_CONFIG_GCC_VERSION >= 29600 +#define CORK_CONFIG_HAVE_GCC_ATTRIBUTES 1 +#else +#define CORK_CONFIG_HAVE_GCC_ATTRIBUTES 0 +#endif + +/* __int128 seems to be available on 64-bit platforms as of GCC 4.6. The + * attribute((mode(TI))) syntax seems to be available as of 4.1. */ + +#if CORK_CONFIG_ARCH_X64 && CORK_CONFIG_GCC_VERSION >= 40600 +#define CORK_CONFIG_HAVE_GCC_INT128 1 +#else +#define CORK_CONFIG_HAVE_GCC_INT128 0 +#endif + +#if CORK_CONFIG_ARCH_X64 && CORK_CONFIG_GCC_VERSION >= 40100 +#define CORK_CONFIG_HAVE_GCC_MODE_ATTRIBUTE 1 +#else +#define CORK_CONFIG_HAVE_GCC_MODE_ATTRIBUTE 0 +#endif + +/* Statement expressions have been available since GCC 3.1. */ + +#if CORK_CONFIG_GCC_VERSION >= 30100 +#define CORK_CONFIG_HAVE_GCC_STATEMENT_EXPRS 1 +#else +#define CORK_CONFIG_HAVE_GCC_STATEMENT_EXPRS 0 +#endif + +/* Thread-local storage has been available since GCC 3.3, but not on Mac + * OS X. */ + +#if !(defined(__APPLE__) && defined(__MACH__)) +#if CORK_CONFIG_GCC_VERSION >= 30300 +#define CORK_CONFIG_HAVE_THREAD_STORAGE_CLASS 1 +#else +#define CORK_CONFIG_HAVE_THREAD_STORAGE_CLASS 0 +#endif +#else +#define CORK_CONFIG_HAVE_THREAD_STORAGE_CLASS 0 +#endif + + +#endif /* LIBCORK_CONFIG_GCC_H */ diff --git a/libcork/include/libcork/config/linux.h b/libcork/include/libcork/config/linux.h new file mode 100644 index 00000000..535924d1 --- /dev/null +++ b/libcork/include/libcork/config/linux.h @@ -0,0 +1,34 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CONFIG_LINUX_H +#define LIBCORK_CONFIG_LINUX_H + +/*----------------------------------------------------------------------- + * Endianness + */ + +#include + +#if __BYTE_ORDER == __BIG_ENDIAN +#define CORK_CONFIG_IS_BIG_ENDIAN 1 +#define CORK_CONFIG_IS_LITTLE_ENDIAN 0 +#elif __BYTE_ORDER == __LITTLE_ENDIAN +#define CORK_CONFIG_IS_BIG_ENDIAN 0 +#define CORK_CONFIG_IS_LITTLE_ENDIAN 1 +#else +#error "Cannot determine system endianness" +#endif + +#define CORK_HAVE_REALLOCF 0 +#define CORK_HAVE_PTHREADS 1 + + +#endif /* LIBCORK_CONFIG_LINUX_H */ diff --git a/libcork/include/libcork/config/macosx.h b/libcork/include/libcork/config/macosx.h new file mode 100644 index 00000000..aa507556 --- /dev/null +++ b/libcork/include/libcork/config/macosx.h @@ -0,0 +1,34 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CONFIG_MACOSX_H +#define LIBCORK_CONFIG_MACOSX_H + +/*----------------------------------------------------------------------- + * Endianness + */ + +#include + +#if BYTE_ORDER == BIG_ENDIAN +#define CORK_CONFIG_IS_BIG_ENDIAN 1 +#define CORK_CONFIG_IS_LITTLE_ENDIAN 0 +#elif BYTE_ORDER == LITTLE_ENDIAN +#define CORK_CONFIG_IS_BIG_ENDIAN 0 +#define CORK_CONFIG_IS_LITTLE_ENDIAN 1 +#else +#error "Cannot determine system endianness" +#endif + +#define CORK_HAVE_REALLOCF 1 +#define CORK_HAVE_PTHREADS 1 + + +#endif /* LIBCORK_CONFIG_MACOSX_H */ diff --git a/libcork/include/libcork/core.h b/libcork/include/libcork/core.h new file mode 100644 index 00000000..083e18fc --- /dev/null +++ b/libcork/include/libcork/core.h @@ -0,0 +1,29 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CORE_H +#define LIBCORK_CORE_H + +/*** include all of the parts ***/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* LIBCORK_CORE_H */ diff --git a/libcork/include/libcork/ds.h b/libcork/include/libcork/ds.h new file mode 100644 index 00000000..8cedd21c --- /dev/null +++ b/libcork/include/libcork/ds.h @@ -0,0 +1,26 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_H +#define LIBCORK_DS_H + +/*** include all of the parts ***/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* LIBCORK_DS_H */ diff --git a/libcork/include/libcork/ds/array.h b/libcork/include/libcork/ds/array.h new file mode 100644 index 00000000..d86a8b6f --- /dev/null +++ b/libcork/include/libcork/ds/array.h @@ -0,0 +1,161 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_ARRAY_H +#define LIBCORK_DS_ARRAY_H + + +#include +#include +#include + + +/*----------------------------------------------------------------------- + * Resizable arrays + */ + +struct cork_array_priv; + +struct cork_raw_array { + void *items; + size_t size; + struct cork_array_priv *priv; +}; + +CORK_API void +cork_raw_array_init(struct cork_raw_array *array, size_t element_size); + +CORK_API void +cork_raw_array_done(struct cork_raw_array *array); + +CORK_API void +cork_raw_array_set_callback_data(struct cork_raw_array *array, + void *user_data, cork_free_f free_user_data); + +CORK_API void +cork_raw_array_set_init(struct cork_raw_array *array, cork_init_f init); + +CORK_API void +cork_raw_array_set_done(struct cork_raw_array *array, cork_done_f done); + +CORK_API void +cork_raw_array_set_reuse(struct cork_raw_array *array, cork_init_f reuse); + +CORK_API void +cork_raw_array_set_remove(struct cork_raw_array *array, cork_done_f remove); + +CORK_API size_t +cork_raw_array_element_size(const struct cork_raw_array *array); + +CORK_API void +cork_raw_array_clear(struct cork_raw_array *array); + +CORK_API void * +cork_raw_array_elements(const struct cork_raw_array *array); + +CORK_API void * +cork_raw_array_at(const struct cork_raw_array *array, size_t index); + +CORK_API size_t +cork_raw_array_size(const struct cork_raw_array *array); + +CORK_API bool +cork_raw_array_is_empty(const struct cork_raw_array *array); + +CORK_API void +cork_raw_array_ensure_size(struct cork_raw_array *array, size_t count); + +CORK_API void * +cork_raw_array_append(struct cork_raw_array *array); + +CORK_API int +cork_raw_array_copy(struct cork_raw_array *dest, + const struct cork_raw_array *src, + cork_copy_f copy, void *user_data); + + +/*----------------------------------------------------------------------- + * Type-checked resizable arrays + */ + +#define cork_array(T) \ + struct { \ + T *items; \ + size_t size; \ + struct cork_array_priv *priv; \ + } + +#define cork_array_element_size(arr) (sizeof((arr)->items[0])) +#define cork_array_elements(arr) ((arr)->items) +#define cork_array_at(arr, i) ((arr)->items[(i)]) +#define cork_array_size(arr) ((arr)->size) +#define cork_array_is_empty(arr) ((arr)->size == 0) +#define cork_array_to_raw(arr) ((struct cork_raw_array *) (void *) (arr)) + +#define cork_array_init(arr) \ + (cork_raw_array_init(cork_array_to_raw(arr), cork_array_element_size(arr))) +#define cork_array_done(arr) \ + (cork_raw_array_done(cork_array_to_raw(arr))) + +#define cork_array_set_callback_data(arr, ud, fud) \ + (cork_raw_array_set_callback_data(cork_array_to_raw(arr), (ud), (fud))) +#define cork_array_set_init(arr, i) \ + (cork_raw_array_set_init(cork_array_to_raw(arr), (i))) +#define cork_array_set_done(arr, d) \ + (cork_raw_array_set_done(cork_array_to_raw(arr), (d))) +#define cork_array_set_reuse(arr, r) \ + (cork_raw_array_set_reuse(cork_array_to_raw(arr), (r))) +#define cork_array_set_remove(arr, r) \ + (cork_raw_array_set_remove(cork_array_to_raw(arr), (r))) + +#define cork_array_clear(arr) \ + (cork_raw_array_clear(cork_array_to_raw(arr))) +#define cork_array_copy(d, s, c, ud) \ + (cork_raw_array_copy(cork_array_to_raw(d), cork_array_to_raw(s), (c), (ud))) + +#define cork_array_ensure_size(arr, count) \ + (cork_raw_array_ensure_size(cork_array_to_raw(arr), (count))) + +#define cork_array_append(arr, element) \ + (cork_raw_array_append(cork_array_to_raw(arr)), \ + ((arr)->items[(arr)->size - 1] = (element), (void) 0)) + +#define cork_array_append_get(arr) \ + (cork_raw_array_append(cork_array_to_raw(arr)), \ + &(arr)->items[(arr)->size - 1]) + + +/*----------------------------------------------------------------------- + * Builtin array types + */ + +CORK_API void +cork_raw_pointer_array_init(struct cork_raw_array *array, cork_free_f free); + +#define cork_pointer_array_init(arr, f) \ + (cork_raw_pointer_array_init(cork_array_to_raw(arr), (f))) + +struct cork_string_array { + const char **items; + size_t size; + struct cork_array_priv *priv; +}; + +CORK_API void +cork_string_array_init(struct cork_string_array *array); + +CORK_API void +cork_string_array_append(struct cork_string_array *array, const char *str); + +CORK_API void +cork_string_array_copy(struct cork_string_array *dest, + const struct cork_string_array *src); + + +#endif /* LIBCORK_DS_ARRAY_H */ diff --git a/libcork/include/libcork/ds/bitset.h b/libcork/include/libcork/ds/bitset.h new file mode 100644 index 00000000..f43ce096 --- /dev/null +++ b/libcork/include/libcork/ds/bitset.h @@ -0,0 +1,64 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_BITS_H +#define LIBCORK_DS_BITS_H + + +#include +#include + + +/*----------------------------------------------------------------------- + * Bit sets + */ + +struct cork_bitset { + uint8_t *bits; + size_t bit_count; + size_t byte_count; +}; + +CORK_API struct cork_bitset * +cork_bitset_new(size_t bit_count); + +CORK_API void +cork_bitset_free(struct cork_bitset *set); + +CORK_API void +cork_bitset_clear(struct cork_bitset *set); + +/* Extract the byte that contains a particular bit in an array. */ +#define cork_bitset_byte_for_bit(set, i) \ + ((set)->bits[(i) / 8]) + +/* Create a bit mask that extracts a particular bit from the byte that it lives + * in. */ +#define cork_bitset_pos_mask_for_bit(i) \ + (0x80 >> ((i) % 8)) + +/* Create a bit mask that extracts everything except for a particular bit from + * the byte that it lives in. */ +#define cork_bitset_neg_mask_for_bit(i) \ + (~cork_bitset_pos_mask_for_bit(i)) + +/* Return whether a particular bit is set in a byte array. Bits are numbered + * from 0, in a big-endian order. */ +#define cork_bitset_get(set, i) \ + ((cork_bitset_byte_for_bit(set, i) & cork_bitset_pos_mask_for_bit(i)) != 0) + +/* Set (or unset) a particular bit is set in a byte array. Bits are numbered + * from 0, in a big-endian order. */ +#define cork_bitset_set(set, i, val) \ + (cork_bitset_byte_for_bit(set, i) = \ + (cork_bitset_byte_for_bit(set, i) & cork_bitset_neg_mask_for_bit(i)) \ + | ((val)? cork_bitset_pos_mask_for_bit(i): 0)) + + +#endif /* LIBCORK_DS_BITS_H */ diff --git a/libcork/include/libcork/ds/buffer.h b/libcork/include/libcork/ds/buffer.h new file mode 100644 index 00000000..39fbbfa1 --- /dev/null +++ b/libcork/include/libcork/ds/buffer.h @@ -0,0 +1,163 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_BUFFER_H +#define LIBCORK_DS_BUFFER_H + + +#include + +#include +#include +#include + + +struct cork_buffer { + /* The current contents of the buffer. */ + void *buf; + /* The current size of the buffer. */ + size_t size; + /* The amount of space allocated for buf. */ + size_t allocated_size; +}; + + +CORK_API void +cork_buffer_init(struct cork_buffer *buffer); + +#define CORK_BUFFER_INIT() { NULL, 0, 0 } + +CORK_API struct cork_buffer * +cork_buffer_new(void); + +CORK_API void +cork_buffer_done(struct cork_buffer *buffer); + +CORK_API void +cork_buffer_free(struct cork_buffer *buffer); + + +CORK_API bool +cork_buffer_equal(const struct cork_buffer *buffer1, + const struct cork_buffer *buffer2); + + +CORK_API void +cork_buffer_ensure_size(struct cork_buffer *buffer, size_t desired_size); + + +CORK_API void +cork_buffer_clear(struct cork_buffer *buffer); + +CORK_API void +cork_buffer_truncate(struct cork_buffer *buffer, size_t length); + +#define cork_buffer_byte(buffer, i) (((const uint8_t *) (buffer)->buf)[(i)]) +#define cork_buffer_char(buffer, i) (((const char *) (buffer)->buf)[(i)]) + + +/*----------------------------------------------------------------------- + * A whole bunch of methods for adding data + */ + +#define cork_buffer_copy(dest, src) \ + (cork_buffer_set((dest), (src)->buf, (src)->size)) + +CORK_API void +cork_buffer_set(struct cork_buffer *buffer, const void *src, size_t length); + +#define cork_buffer_append_copy(dest, src) \ + (cork_buffer_append((dest), (src)->buf, (src)->size)) + +CORK_API void +cork_buffer_append(struct cork_buffer *buffer, const void *src, size_t length); + + +CORK_API void +cork_buffer_set_string(struct cork_buffer *buffer, const char *str); + +CORK_API void +cork_buffer_append_string(struct cork_buffer *buffer, const char *str); + +#define cork_buffer_set_literal(buffer, str) \ + (cork_buffer_set((buffer), (str), sizeof((str)) - 1)) + +#define cork_buffer_append_literal(buffer, str) \ + (cork_buffer_append((buffer), (str), sizeof((str)) - 1)) + + +CORK_API void +cork_buffer_printf(struct cork_buffer *buffer, const char *format, ...) + CORK_ATTR_PRINTF(2,3); + +CORK_API void +cork_buffer_append_printf(struct cork_buffer *buffer, const char *format, ...) + CORK_ATTR_PRINTF(2,3); + +CORK_API void +cork_buffer_vprintf(struct cork_buffer *buffer, const char *format, + va_list args) + CORK_ATTR_PRINTF(2,0); + +CORK_API void +cork_buffer_append_vprintf(struct cork_buffer *buffer, const char *format, + va_list args) + CORK_ATTR_PRINTF(2,0); + + +/*----------------------------------------------------------------------- + * Some helpers for pretty-printing data + */ + +CORK_API void +cork_buffer_append_indent(struct cork_buffer *buffer, size_t indent); + +CORK_API void +cork_buffer_append_c_string(struct cork_buffer *buffer, + const char *src, size_t length); + +CORK_API void +cork_buffer_append_hex_dump(struct cork_buffer *buffer, size_t indent, + const char *src, size_t length); + +CORK_API void +cork_buffer_append_multiline(struct cork_buffer *buffer, size_t indent, + const char *src, size_t length); + +CORK_API void +cork_buffer_append_binary(struct cork_buffer *buffer, size_t indent, + const char *src, size_t length); + + +/*----------------------------------------------------------------------- + * Buffer's managed buffer/slice implementation + */ + +#include +#include + +CORK_API struct cork_managed_buffer * +cork_buffer_to_managed_buffer(struct cork_buffer *buffer); + +CORK_API int +cork_buffer_to_slice(struct cork_buffer *buffer, struct cork_slice *slice); + + +/*----------------------------------------------------------------------- + * Buffer's stream consumer implementation + */ + +#include + +CORK_API struct cork_stream_consumer * +cork_buffer_to_stream_consumer(struct cork_buffer *buffer); + + +#endif /* LIBCORK_DS_BUFFER_H */ diff --git a/libcork/include/libcork/ds/dllist.h b/libcork/include/libcork/ds/dllist.h new file mode 100644 index 00000000..7fc22bfe --- /dev/null +++ b/libcork/include/libcork/ds/dllist.h @@ -0,0 +1,151 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2014, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_DLLIST_H +#define LIBCORK_DS_DLLIST_H + +#include +#include + + +struct cork_dllist_item { + /* A pointer to the next element in the list. */ + struct cork_dllist_item *next; + /* A pointer to the previous element in the list. */ + struct cork_dllist_item *prev; +}; + + +struct cork_dllist { + /* The sentinel element for this list. */ + struct cork_dllist_item head; +}; + +#define CORK_DLLIST_INIT(list) { { &(list).head, &(list).head } } + +#define cork_dllist_init(list) \ + do { \ + (list)->head.next = &(list)->head; \ + (list)->head.prev = &(list)->head; \ + } while (0) + + + +/* DEPRECATED! Use cork_dllist_foreach or cork_dllist_visit instead. */ +typedef void +(*cork_dllist_map_func)(struct cork_dllist_item *element, void *user_data); + +CORK_API void +cork_dllist_map(struct cork_dllist *list, + cork_dllist_map_func func, void *user_data); + + +typedef int +cork_dllist_visit_f(void *ud, struct cork_dllist_item *element); + +CORK_API int +cork_dllist_visit(struct cork_dllist *list, void *ud, + cork_dllist_visit_f *visit); + + +#define cork_dllist_foreach_void(list, curr, _next) \ + for ((curr) = cork_dllist_start((list)), (_next) = (curr)->next; \ + !cork_dllist_is_end((list), (curr)); \ + (curr) = (_next), (_next) = (curr)->next) + +#define cork_dllist_foreach(list, curr, _next, etype, element, item_field) \ + for ((curr) = cork_dllist_start((list)), (_next) = (curr)->next, \ + (element) = cork_container_of((curr), etype, item_field); \ + !cork_dllist_is_end((list), (curr)); \ + (curr) = (_next), (_next) = (curr)->next, \ + (element) = cork_container_of((curr), etype, item_field)) + + +CORK_API size_t +cork_dllist_size(const struct cork_dllist *list); + + +#define cork_dllist_add_after(pred, element) \ + do { \ + (element)->prev = (pred); \ + (element)->next = (pred)->next; \ + (pred)->next->prev = (element); \ + (pred)->next = (element); \ + } while (0) + +#define cork_dllist_add_before(succ, element) \ + do { \ + (element)->next = (succ); \ + (element)->prev = (succ)->prev; \ + (succ)->prev->next = (element); \ + (succ)->prev = (element); \ + } while (0) + +#define cork_dllist_add_to_head(list, element) \ + cork_dllist_add_after(&(list)->head, (element)) + +#define cork_dllist_add_to_tail(list, element) \ + cork_dllist_add_before(&(list)->head, (element)) + +#define cork_dllist_add cork_dllist_add_to_tail + + +#define cork_dllist_add_list_to_head(dest, src) \ + do { \ + struct cork_dllist_item *dest_start = cork_dllist_start(dest); \ + struct cork_dllist_item *src_start = cork_dllist_start(src); \ + dest_start->prev = &(src)->head; \ + src_start->prev = &(dest)->head; \ + (src)->head.next = dest_start; \ + (dest)->head.next = src_start; \ + cork_dllist_remove(&(src)->head); \ + cork_dllist_init(src); \ + } while (0) + +#define cork_dllist_add_list_to_tail(dest, src) \ + do { \ + struct cork_dllist_item *dest_end = cork_dllist_end(dest); \ + struct cork_dllist_item *src_end = cork_dllist_end(src); \ + dest_end->next = &(src)->head; \ + src_end->next = &(dest)->head; \ + (src)->head.prev = dest_end; \ + (dest)->head.prev = src_end; \ + cork_dllist_remove(&(src)->head); \ + cork_dllist_init(src); \ + } while (0) + + +#define cork_dllist_remove(element) \ + do { \ + (element)->prev->next = (element)->next; \ + (element)->next->prev = (element)->prev; \ + } while (0) + + +#define cork_dllist_is_empty(list) \ + (cork_dllist_is_end((list), cork_dllist_start((list)))) + + +#define cork_dllist_head(list) \ + (((list)->head.next == &(list)->head)? NULL: (list)->head.next) +#define cork_dllist_tail(list) \ + (((list)->head.prev == &(list)->head)? NULL: (list)->head.prev) + +#define cork_dllist_start(list) \ + ((list)->head.next) +#define cork_dllist_end(list) \ + ((list)->head.prev) + +#define cork_dllist_is_start(list, element) \ + ((element) == &(list)->head) +#define cork_dllist_is_end(list, element) \ + ((element) == &(list)->head) + + +#endif /* LIBCORK_DS_DLLIST_H */ diff --git a/libcork/include/libcork/ds/hash-table.h b/libcork/include/libcork/ds/hash-table.h new file mode 100644 index 00000000..6a0eee40 --- /dev/null +++ b/libcork/include/libcork/ds/hash-table.h @@ -0,0 +1,159 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_HASH_TABLE_H +#define LIBCORK_DS_HASH_TABLE_H + +#include +#include +#include +#include +#include +#include + + +/*----------------------------------------------------------------------- + * Hash tables + */ + +struct cork_hash_table_entry { + cork_hash hash; + void *key; + void *value; +}; + + +struct cork_hash_table; + +CORK_API struct cork_hash_table * +cork_hash_table_new(size_t initial_size, unsigned int flags); + +CORK_API void +cork_hash_table_free(struct cork_hash_table *table); + + +CORK_API void +cork_hash_table_set_user_data(struct cork_hash_table *table, + void *user_data, cork_free_f free_user_data); + +CORK_API void +cork_hash_table_set_equals(struct cork_hash_table *table, cork_equals_f equals); + +CORK_API void +cork_hash_table_set_free_key(struct cork_hash_table *table, cork_free_f free); + +CORK_API void +cork_hash_table_set_free_value(struct cork_hash_table *table, cork_free_f free); + +CORK_API void +cork_hash_table_set_hash(struct cork_hash_table *table, cork_hash_f hash); + + +CORK_API void +cork_hash_table_clear(struct cork_hash_table *table); + + +CORK_API void +cork_hash_table_ensure_size(struct cork_hash_table *table, + size_t desired_count); + +CORK_API size_t +cork_hash_table_size(const struct cork_hash_table *table); + + +CORK_API void * +cork_hash_table_get(const struct cork_hash_table *table, const void *key); + +CORK_API void * +cork_hash_table_get_hash(const struct cork_hash_table *table, + cork_hash hash, const void *key); + +CORK_API struct cork_hash_table_entry * +cork_hash_table_get_entry(const struct cork_hash_table *table, + const void *key); + +CORK_API struct cork_hash_table_entry * +cork_hash_table_get_entry_hash(const struct cork_hash_table *table, + cork_hash hash, const void *key); + +CORK_API struct cork_hash_table_entry * +cork_hash_table_get_or_create(struct cork_hash_table *table, + void *key, bool *is_new); + +CORK_API struct cork_hash_table_entry * +cork_hash_table_get_or_create_hash(struct cork_hash_table *table, + cork_hash hash, void *key, bool *is_new); + +CORK_API void +cork_hash_table_put(struct cork_hash_table *table, + void *key, void *value, + bool *is_new, void **old_key, void **old_value); + +CORK_API void +cork_hash_table_put_hash(struct cork_hash_table *table, + cork_hash hash, void *key, void *value, + bool *is_new, void **old_key, void **old_value); + +CORK_API void +cork_hash_table_delete_entry(struct cork_hash_table *table, + struct cork_hash_table_entry *entry); + +CORK_API bool +cork_hash_table_delete(struct cork_hash_table *table, const void *key, + void **deleted_key, void **deleted_value); + +CORK_API bool +cork_hash_table_delete_hash(struct cork_hash_table *table, + cork_hash hash, const void *key, + void **deleted_key, void **deleted_value); + + +enum cork_hash_table_map_result { + /* Abort the current @ref cork_hash_table_map operation. */ + CORK_HASH_TABLE_MAP_ABORT = 0, + /* Continue on to the next entry in the hash table. */ + CORK_HASH_TABLE_MAP_CONTINUE = 1, + /* Delete the entry that was just processed, and then continue on to + * the next entry in the hash table. */ + CORK_HASH_TABLE_MAP_DELETE = 2 +}; + +typedef enum cork_hash_table_map_result +(*cork_hash_table_map_f)(void *user_data, struct cork_hash_table_entry *entry); + +CORK_API void +cork_hash_table_map(struct cork_hash_table *table, void *user_data, + cork_hash_table_map_f mapper); + + +struct cork_hash_table_iterator { + struct cork_hash_table *table; + void *priv; +}; + +CORK_API void +cork_hash_table_iterator_init(struct cork_hash_table *table, + struct cork_hash_table_iterator *iterator); + +CORK_API struct cork_hash_table_entry * +cork_hash_table_iterator_next(struct cork_hash_table_iterator *iterator); + + +/*----------------------------------------------------------------------- + * Built-in key types + */ + +CORK_API struct cork_hash_table * +cork_string_hash_table_new(size_t initial_size, unsigned int flags); + +CORK_API struct cork_hash_table * +cork_pointer_hash_table_new(size_t initial_size, unsigned int flags); + + +#endif /* LIBCORK_DS_HASH_TABLE_H */ diff --git a/libcork/include/libcork/ds/managed-buffer.h b/libcork/include/libcork/ds/managed-buffer.h new file mode 100644 index 00000000..e74ef3b6 --- /dev/null +++ b/libcork/include/libcork/ds/managed-buffer.h @@ -0,0 +1,76 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_MANAGED_BUFFER_H +#define LIBCORK_DS_MANAGED_BUFFER_H + +#include +#include +#include + + +/*----------------------------------------------------------------------- + * Managed buffers + */ + +struct cork_managed_buffer; + +struct cork_managed_buffer_iface { + /* Free the contents of a managed buffer, and the managed buffer + * object itself. */ + void + (*free)(struct cork_managed_buffer *buf); +}; + + +struct cork_managed_buffer { + /* The buffer that this instance manages */ + const void *buf; + /* The size of buf */ + size_t size; + /* A reference count for the buffer. If this drops to 0, the buffer + * will be finalized. */ + volatile int ref_count; + /* The managed buffer implementation for this instance. */ + struct cork_managed_buffer_iface *iface; +}; + + +CORK_API struct cork_managed_buffer * +cork_managed_buffer_new_copy(const void *buf, size_t size); + + +typedef void +(*cork_managed_buffer_freer)(void *buf, size_t size); + +CORK_API struct cork_managed_buffer * +cork_managed_buffer_new(const void *buf, size_t size, + cork_managed_buffer_freer free); + + +CORK_API struct cork_managed_buffer * +cork_managed_buffer_ref(struct cork_managed_buffer *buf); + +CORK_API void +cork_managed_buffer_unref(struct cork_managed_buffer *buf); + + +CORK_API int +cork_managed_buffer_slice(struct cork_slice *dest, + struct cork_managed_buffer *buffer, + size_t offset, size_t length); + +CORK_API int +cork_managed_buffer_slice_offset(struct cork_slice *dest, + struct cork_managed_buffer *buffer, + size_t offset); + + +#endif /* LIBCORK_DS_MANAGED_BUFFER_H */ diff --git a/libcork/include/libcork/ds/ring-buffer.h b/libcork/include/libcork/ds/ring-buffer.h new file mode 100644 index 00000000..d76affdc --- /dev/null +++ b/libcork/include/libcork/ds/ring-buffer.h @@ -0,0 +1,60 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_RING_BUFFER_H +#define LIBCORK_DS_RING_BUFFER_H + +#include +#include + + +struct cork_ring_buffer { + /* The elements of the ring buffer */ + void **elements; + /* The number of elements that can be stored in this ring + * buffer. */ + size_t allocated_size; + /* The actual number of elements currently in the ring buffer. */ + size_t size; + /* The index of the next element to read from the buffer */ + size_t read_index; + /* The index of the next element to write into the buffer */ + size_t write_index; +}; + + +CORK_API int +cork_ring_buffer_init(struct cork_ring_buffer *buf, size_t size); + +CORK_API struct cork_ring_buffer * +cork_ring_buffer_new(size_t size); + +CORK_API void +cork_ring_buffer_done(struct cork_ring_buffer *buf); + +CORK_API void +cork_ring_buffer_free(struct cork_ring_buffer *buf); + + +#define cork_ring_buffer_is_empty(buf) ((buf)->size == 0) +#define cork_ring_buffer_is_full(buf) ((buf)->size == (buf)->allocated_size) + + +CORK_API int +cork_ring_buffer_add(struct cork_ring_buffer *buf, void *element); + +CORK_API void * +cork_ring_buffer_pop(struct cork_ring_buffer *buf); + +CORK_API void * +cork_ring_buffer_peek(struct cork_ring_buffer *buf); + + +#endif /* LIBCORK_DS_RING_BUFFER_H */ diff --git a/libcork/include/libcork/ds/slice.h b/libcork/include/libcork/ds/slice.h new file mode 100644 index 00000000..9daefee3 --- /dev/null +++ b/libcork/include/libcork/ds/slice.h @@ -0,0 +1,151 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_SLICE_H +#define LIBCORK_DS_SLICE_H + +#include +#include + + +/*----------------------------------------------------------------------- + * Error handling + */ + +/* hash of "libcork/ds/slice.h" */ +#define CORK_SLICE_ERROR 0x960ca750 + +enum cork_slice_error { + /* Trying to slice a nonexistent subset of a buffer */ + CORK_SLICE_INVALID_SLICE +}; + + +/*----------------------------------------------------------------------- + * Slices + */ + +struct cork_slice; + +struct cork_slice_iface { + /* Free the slice. Can be NULL if you don't need to free any + * underlying buffer. */ + void + (*free)(struct cork_slice *self); + + /* Create a copy of a slice. You can assume that offset and length + * refer to a valid subset of the buffer. */ + int + (*copy)(struct cork_slice *dest, const struct cork_slice *self, + size_t offset, size_t length); + + /* Create a “light” copy of a slice. A light copy is not allowed to exist + * longer than the slice that it was copied from, which can sometimes let + * you perform less work to produce the copy. You can assume that offset + * and length refer to a valid subset of the buffer. */ + int + (*light_copy)(struct cork_slice *dest, const struct cork_slice *self, + size_t offset, size_t length); + + /* Update the current slice to point at a different subset. You can + * assume that offset and length refer to a valid subset of the + * buffer. Can be NULL if you don't need to do anything special to + * the underlying buffer; in this case, we'll update the slice's buf + * and size fields for you. */ + int + (*slice)(struct cork_slice *self, size_t offset, size_t length); +}; + + +struct cork_slice { + /* The beginning of the sliced portion of the buffer. */ + const void *buf; + /* The length of the sliced portion of the buffer. */ + size_t size; + /* The slice implementation of the underlying buffer. */ + struct cork_slice_iface *iface; + /* An opaque pointer used by the slice implementation to refer to + * the underlying buffer. */ + void *user_data; +}; + + +CORK_API void +cork_slice_clear(struct cork_slice *slice); + +#define cork_slice_is_empty(slice) ((slice)->buf == NULL) + + +CORK_API int +cork_slice_copy(struct cork_slice *dest, const struct cork_slice *slice, + size_t offset, size_t length); + +#define cork_slice_copy_fast(dest, slice, offset, length) \ + ((slice)->iface->copy((dest), (slice), (offset), (length))) + +CORK_API int +cork_slice_copy_offset(struct cork_slice *dest, const struct cork_slice *slice, + size_t offset); + +#define cork_slice_copy_offset_fast(dest, slice, offset) \ + ((slice)->iface->copy \ + ((dest), (slice), (offset), (slice)->size - (offset))) + + +CORK_API int +cork_slice_light_copy(struct cork_slice *dest, const struct cork_slice *slice, + size_t offset, size_t length); + +#define cork_slice_light_copy_fast(dest, slice, offset, length) \ + ((slice)->iface->light_copy((dest), (slice), (offset), (length))) + +CORK_API int +cork_slice_light_copy_offset(struct cork_slice *dest, + const struct cork_slice *slice, size_t offset); + +#define cork_slice_light_copy_offset_fast(dest, slice, offset) \ + ((slice)->iface->light_copy \ + ((dest), (slice), (offset), (slice)->size - (offset))) + + +CORK_API int +cork_slice_slice(struct cork_slice *slice, size_t offset, size_t length); + +#define cork_slice_slice_fast(_slice, offset, length) \ + ((_slice)->iface->slice == NULL? \ + ((_slice)->buf += (offset), (_slice)->size = (length), 0): \ + ((_slice)->iface->slice((_slice), (offset), (length)))) + +CORK_API int +cork_slice_slice_offset(struct cork_slice *slice, size_t offset); + +#define cork_slice_slice_offset_fast(_slice, offset) \ + ((_slice)->iface->slice == NULL? \ + ((_slice)->buf += (offset), (_slice)->size -= (offset), 0): \ + ((_slice)->iface->slice \ + ((_slice), (offset), (_slice)->size - (offset)))) + + +CORK_API void +cork_slice_finish(struct cork_slice *slice); + +CORK_API bool +cork_slice_equal(const struct cork_slice *slice1, + const struct cork_slice *slice2); + +CORK_API void +cork_slice_init_static(struct cork_slice *dest, const void *buf, size_t size); + +CORK_API void +cork_slice_init_copy_once(struct cork_slice *dest, const void *buf, + size_t size); + + +#endif /* LIBCORK_DS_SLICE_H */ diff --git a/libcork/include/libcork/ds/stream.h b/libcork/include/libcork/ds/stream.h new file mode 100644 index 00000000..b3697257 --- /dev/null +++ b/libcork/include/libcork/ds/stream.h @@ -0,0 +1,64 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_DS_STREAM_H +#define LIBCORK_DS_STREAM_H + +#include + +#include +#include + + +struct cork_stream_consumer { + int + (*data)(struct cork_stream_consumer *consumer, + const void *buf, size_t size, bool is_first_chunk); + + int + (*eof)(struct cork_stream_consumer *consumer); + + void + (*free)(struct cork_stream_consumer *consumer); +}; + + +#define cork_stream_consumer_data(consumer, buf, size, is_first) \ + ((consumer)->data((consumer), (buf), (size), (is_first))) + +#define cork_stream_consumer_eof(consumer) \ + ((consumer)->eof((consumer))) + +#define cork_stream_consumer_free(consumer) \ + ((consumer)->free((consumer))) + + +CORK_API int +cork_consume_fd(struct cork_stream_consumer *consumer, int fd); + +CORK_API int +cork_consume_file(struct cork_stream_consumer *consumer, FILE *fp); + +CORK_API int +cork_consume_file_from_path(struct cork_stream_consumer *consumer, + const char *path, int flags); + + +CORK_API struct cork_stream_consumer * +cork_fd_consumer_new(int fd); + +CORK_API struct cork_stream_consumer * +cork_file_consumer_new(FILE *fp); + +CORK_API struct cork_stream_consumer * +cork_file_from_path_consumer_new(const char *path, int flags); + + +#endif /* LIBCORK_DS_STREAM_H */ diff --git a/libcork/include/libcork/helpers/errors.h b/libcork/include/libcork/helpers/errors.h new file mode 100644 index 00000000..37766757 --- /dev/null +++ b/libcork/include/libcork/helpers/errors.h @@ -0,0 +1,142 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_HELPERS_ERRORS_H +#define LIBCORK_HELPERS_ERRORS_H + + +/* This header is *not* automatically included when you include + * libcork/core.h, since we define some macros that don't include a + * cork_ or CORK_ prefix. Don't want to pollute your namespace unless + * you ask for it! */ + + +#include +#include +#include + + +#if !defined(CORK_PRINT_ERRORS) +#define CORK_PRINT_ERRORS 0 +#endif + +#if !defined(CORK_PRINT_ERROR) +#if CORK_PRINT_ERRORS +#include +#define CORK_PRINT_ERROR_(func, file, line) \ + fprintf(stderr, "---\nError in %s (%s:%u)\n %s\n", \ + (func), (file), (unsigned int) (line), \ + cork_error_message()); +#define CORK_PRINT_ERROR() CORK_PRINT_ERROR_(__func__, __FILE__, __LINE__) +#else +#define CORK_PRINT_ERROR() /* do nothing */ +#endif +#endif + + +/* A bunch of macros for calling a function that returns an error. If + * an error occurs, it will automatically be propagated out as the + * result of your own function. With these macros, you won't have a + * check to check or modify the error condition; it's returned as-is. + * + * XZ_check + * + * where: + * + * X = what happens if an error occurs + * "e" = jump to the "error" label + * "rY" = return a default error result (Y defined below) + * "x" = return an error result that you specify + * + * Y = your return type + * "i" = int + * "p" = some pointer type + * + * Z = the return type of the function you're calling + * "e" = use cork_error_occurred() to check + * "i" = int + * "p" = some pointer type + * + * In all cases, we assume that your function has a cork_error parameter + * called "err". + */ + + +/* jump to "error" label */ + +#define ee_check(call) \ + do { \ + (call); \ + if (CORK_UNLIKELY(cork_error_occurred())) { \ + CORK_PRINT_ERROR(); \ + goto error; \ + } \ + } while (0) + +#define ei_check(call) \ + do { \ + int __rc = (call); \ + if (CORK_UNLIKELY(__rc != 0)) { \ + CORK_PRINT_ERROR(); \ + goto error; \ + } \ + } while (0) + +#define ep_check(call) \ + do { \ + const void *__result = (call); \ + if (CORK_UNLIKELY(__result == NULL)) { \ + CORK_PRINT_ERROR(); \ + goto error; \ + } \ + } while (0) + + +/* return specific error code */ + +#define xe_check(result, call) \ + do { \ + (call); \ + if (CORK_UNLIKELY(cork_error_occurred())) { \ + CORK_PRINT_ERROR(); \ + return result; \ + } \ + } while (0) + +#define xi_check(result, call) \ + do { \ + int __rc = (call); \ + if (CORK_UNLIKELY(__rc != 0)) { \ + CORK_PRINT_ERROR(); \ + return result; \ + } \ + } while (0) + +#define xp_check(result, call) \ + do { \ + const void *__result = (call); \ + if (CORK_UNLIKELY(__result == NULL)) { \ + CORK_PRINT_ERROR(); \ + return result; \ + } \ + } while (0) + + +/* return default error code */ + +#define rie_check(call) xe_check(-1, call) +#define rii_check(call) xi_check(__rc, call) +#define rip_check(call) xp_check(-1, call) +#define rpe_check(call) xe_check(NULL, call) +#define rpi_check(call) xi_check(NULL, call) +#define rpp_check(call) xp_check(NULL, call) + + +#endif /* LIBCORK_HELPERS_ERRORS_H */ diff --git a/libcork/include/libcork/helpers/gc.h b/libcork/include/libcork/helpers/gc.h new file mode 100644 index 00000000..43742445 --- /dev/null +++ b/libcork/include/libcork/helpers/gc.h @@ -0,0 +1,51 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2011-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_HELPERS_REFCOUNT_H +#define LIBCORK_HELPERS_REFCOUNT_H + + +#include +#include + + +#define _free_(name) \ +static void \ +name##__free(void *obj) + + +#define _recurse_(name) \ +static void \ +name##__recurse(struct cork_gc *gc, void *obj, \ + cork_gc_recurser recurse, void *ud) + + +#define _gc_(name) \ +static struct cork_gc_obj_iface name##__gc = { \ + name##__free, name##__recurse \ +}; + +#define _gc_no_free_(name) \ +static struct cork_gc_obj_iface name##__gc = { \ + NULL, name##__recurse \ +}; + +#define _gc_no_recurse_(name) \ +static struct cork_gc_obj_iface name##__gc = { \ + name##__free, NULL \ +}; + +#define _gc_leaf_(name) \ +static struct cork_gc_obj_iface name##__gc = { \ + NULL, NULL \ +}; + + +#endif /* LIBCORK_HELPERS_REFCOUNT_H */ diff --git a/libcork/include/libcork/helpers/posix.h b/libcork/include/libcork/helpers/posix.h new file mode 100644 index 00000000..7a933d5b --- /dev/null +++ b/libcork/include/libcork/helpers/posix.h @@ -0,0 +1,87 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_HELPERS_POSIX_H +#define LIBCORK_HELPERS_POSIX_H + +/* This header is *not* automatically included when you include + * libcork/core.h, since we define some macros that don't include a + * cork_ or CORK_ prefix. Don't want to pollute your namespace unless + * you ask for it! */ + +#include + +#include +#include +#include + + +#if !defined(CORK_PRINT_ERRORS) +#define CORK_PRINT_ERRORS 0 +#endif + +#if !defined(CORK_PRINT_ERROR) +#if CORK_PRINT_ERRORS +#include +#define CORK_PRINT_ERROR_(func, file, line) \ + fprintf(stderr, "---\nError in %s (%s:%u)\n %s\n", \ + (func), (file), (unsigned int) (line), \ + cork_error_message()); +#define CORK_PRINT_ERROR() CORK_PRINT_ERROR_(__func__, __FILE__, __LINE__) +#else +#define CORK_PRINT_ERROR() /* do nothing */ +#endif +#endif + + +#define xi_check_posix(call, on_error) \ + do { \ + while (true) { \ + if ((call) == -1) { \ + if (errno == EINTR) { \ + continue; \ + } else { \ + cork_system_error_set(); \ + CORK_PRINT_ERROR(); \ + on_error; \ + } \ + } else { \ + break; \ + } \ + } \ + } while (0) + +#define xp_check_posix(call, on_error) \ + do { \ + while (true) { \ + if ((call) == NULL) { \ + if (errno == EINTR) { \ + continue; \ + } else { \ + cork_system_error_set(); \ + CORK_PRINT_ERROR(); \ + on_error; \ + } \ + } else { \ + break; \ + } \ + } \ + } while (0) + + +#define ei_check_posix(call) xi_check_posix(call, goto error) +#define rii_check_posix(call) xi_check_posix(call, return -1) +#define rpi_check_posix(call) xi_check_posix(call, return NULL) + +#define ep_check_posix(call) xp_check_posix(call, goto error) +#define rip_check_posix(call) xp_check_posix(call, return -1) +#define rpp_check_posix(call) xp_check_posix(call, return NULL) + + +#endif /* LIBCORK_HELPERS_POSIX_H */ diff --git a/libcork/include/libcork/os.h b/libcork/include/libcork/os.h new file mode 100644 index 00000000..11639628 --- /dev/null +++ b/libcork/include/libcork/os.h @@ -0,0 +1,20 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_OS_H +#define LIBCORK_OS_H + +/*** include all of the parts ***/ + +#include +#include +#include + +#endif /* LIBCORK_OS_H */ diff --git a/libcork/include/libcork/os/files.h b/libcork/include/libcork/os/files.h new file mode 100644 index 00000000..82f1f30d --- /dev/null +++ b/libcork/include/libcork/os/files.h @@ -0,0 +1,271 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CORE_FILES_H +#define LIBCORK_CORE_FILES_H + +#include +#include + + +/*----------------------------------------------------------------------- + * Paths + */ + +struct cork_path; + +/* path can be relative or absolute */ +CORK_API struct cork_path * +cork_path_new(const char *path); + +CORK_API struct cork_path * +cork_path_clone(const struct cork_path *other); + +CORK_API void +cork_path_free(struct cork_path *path); + + +CORK_API void +cork_path_set(struct cork_path *path, const char *content); + +CORK_API const char * +cork_path_get(const struct cork_path *path); + + +CORK_API int +cork_path_set_cwd(struct cork_path *path); + +CORK_API struct cork_path * +cork_path_cwd(void); + + +CORK_API int +cork_path_set_absolute(struct cork_path *path); + +CORK_API struct cork_path * +cork_path_absolute(const struct cork_path *other); + + +CORK_API void +cork_path_append(struct cork_path *path, const char *more); + +CORK_API void +cork_path_append_path(struct cork_path *path, const struct cork_path *more); + +CORK_API struct cork_path * +cork_path_join(const struct cork_path *other, const char *more); + +CORK_API struct cork_path * +cork_path_join_path(const struct cork_path *other, + const struct cork_path *more); + + +CORK_API void +cork_path_set_basename(struct cork_path *path); + +CORK_API struct cork_path * +cork_path_basename(const struct cork_path *other); + + +CORK_API void +cork_path_set_dirname(struct cork_path *path); + +CORK_API struct cork_path * +cork_path_dirname(const struct cork_path *other); + + +/*----------------------------------------------------------------------- + * Lists of paths + */ + +struct cork_path_list; + +CORK_API struct cork_path_list * +cork_path_list_new_empty(void); + +/* list must be a colon-separated list of paths */ +CORK_API struct cork_path_list * +cork_path_list_new(const char *list); + +CORK_API void +cork_path_list_free(struct cork_path_list *list); + +CORK_API const char * +cork_path_list_to_string(const struct cork_path_list *list); + +/* Takes control of path. path must not already be in the list. */ +CORK_API void +cork_path_list_add(struct cork_path_list *list, struct cork_path *path); + +CORK_API size_t +cork_path_list_size(const struct cork_path_list *list); + +/* The list still owns path; you must not free it or modify it. */ +CORK_API const struct cork_path * +cork_path_list_get(const struct cork_path_list *list, size_t index); + + +/*----------------------------------------------------------------------- + * Files + */ + +#define CORK_FILE_RECURSIVE 0x0001 +#define CORK_FILE_PERMISSIVE 0x0002 + +typedef unsigned int cork_file_mode; + +enum cork_file_type { + CORK_FILE_MISSING = 0, + CORK_FILE_REGULAR = 1, + CORK_FILE_DIRECTORY = 2, + CORK_FILE_SYMLINK = 3, + CORK_FILE_UNKNOWN = 4 +}; + +struct cork_file; + +CORK_API struct cork_file * +cork_file_new(const char *path); + +/* Takes control of path */ +CORK_API struct cork_file * +cork_file_new_from_path(struct cork_path *path); + +CORK_API void +cork_file_free(struct cork_file *file); + +/* File owns the result; you should not free it */ +CORK_API const struct cork_path * +cork_file_path(struct cork_file *file); + +CORK_API int +cork_file_exists(struct cork_file *file, bool *exists); + +CORK_API int +cork_file_type(struct cork_file *file, enum cork_file_type *type); + + +typedef int +(*cork_file_directory_iterator)(struct cork_file *child, const char *rel_name, + void *user_data); + +CORK_API int +cork_file_iterate_directory(struct cork_file *file, + cork_file_directory_iterator iterator, + void *user_data); + +/* If flags includes CORK_FILE_RECURSIVE, this creates parent directories, + * if needed. If flags doesn't include CORK_FILE_PERMISSIVE, then it's an error + * if the directory already exists. */ +CORK_API int +cork_file_mkdir(struct cork_file *file, cork_file_mode mode, + unsigned int flags); + +/* Removes a file or directory. If file is a directory, and flags contains + * CORK_FILE_RECURSIVE, then all of the directory's contents are removed, too. + * Otherwise, the directory must already be empty. */ +CORK_API int +cork_file_remove(struct cork_file *file, unsigned int flags); + + +CORK_API struct cork_file * +cork_path_list_find_file(const struct cork_path_list *list, + const char *rel_path); + + +/*----------------------------------------------------------------------- + * Lists of files + */ + +struct cork_file_list; + +CORK_API struct cork_file_list * +cork_file_list_new_empty(void); + +CORK_API struct cork_file_list * +cork_file_list_new(struct cork_path_list *path_list); + +CORK_API void +cork_file_list_free(struct cork_file_list *list); + +/* Takes control of file. file must not already be in the list. */ +CORK_API void +cork_file_list_add(struct cork_file_list *list, struct cork_file *file); + +CORK_API size_t +cork_file_list_size(struct cork_file_list *list); + +/* The list still owns file; you must not free it. Editing the file updates the + * entry in the list. */ +CORK_API struct cork_file * +cork_file_list_get(struct cork_file_list *list, size_t index); + + +CORK_API struct cork_file_list * +cork_path_list_find_files(const struct cork_path_list *list, + const char *rel_path); + + +/*----------------------------------------------------------------------- + * Walking a directory tree + */ + +#define CORK_SKIP_DIRECTORY 1 + +struct cork_dir_walker { + int + (*enter_directory)(struct cork_dir_walker *walker, const char *full_path, + const char *rel_path, const char *base_name); + + int + (*file)(struct cork_dir_walker *walker, const char *full_path, + const char *rel_path, const char *base_name); + + int + (*leave_directory)(struct cork_dir_walker *walker, const char *full_path, + const char *rel_path, const char *base_name); +}; + +#define cork_dir_walker_enter_directory(w, fp, rp, bn) \ + ((w)->enter_directory((w), (fp), (rp), (bn))) + +#define cork_dir_walker_file(w, fp, rp, bn) \ + ((w)->file((w), (fp), (rp), (bn))) + +#define cork_dir_walker_leave_directory(w, fp, rp, bn) \ + ((w)->leave_directory((w), (fp), (rp), (bn))) + + +CORK_API int +cork_walk_directory(const char *path, struct cork_dir_walker *walker); + + +/*----------------------------------------------------------------------- + * Standard paths and path lists + */ + +CORK_API struct cork_path * +cork_path_home(void); + + +CORK_API struct cork_path_list * +cork_path_config_paths(void); + +CORK_API struct cork_path_list * +cork_path_data_paths(void); + +CORK_API struct cork_path * +cork_path_user_cache_path(void); + +CORK_API struct cork_path * +cork_path_user_runtime_path(void); + + +#endif /* LIBCORK_CORE_FILES_H */ diff --git a/libcork/include/libcork/os/process.h b/libcork/include/libcork/os/process.h new file mode 100644 index 00000000..5d7813dc --- /dev/null +++ b/libcork/include/libcork/os/process.h @@ -0,0 +1,28 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_CORE_PROCESS_H +#define LIBCORK_CORE_PROCESS_H + +#include + + +typedef void +(*cork_cleanup_function)(void); + +CORK_API void +cork_cleanup_at_exit_named(const char *name, int priority, + cork_cleanup_function function); + +#define cork_cleanup_at_exit(priority, function) \ + cork_cleanup_at_exit_named(#function, priority, function) + + +#endif /* LIBCORK_CORE_PROCESS_H */ diff --git a/libcork/include/libcork/os/subprocess.h b/libcork/include/libcork/os/subprocess.h new file mode 100644 index 00000000..6aba53fb --- /dev/null +++ b/libcork/include/libcork/os/subprocess.h @@ -0,0 +1,196 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_OS_SUBPROCESS_H +#define LIBCORK_OS_SUBPROCESS_H + +#include + +#include +#include +#include +#include + + +/*----------------------------------------------------------------------- + * Environments + */ + +struct cork_env; + +CORK_API struct cork_env * +cork_env_new(void); + +CORK_API struct cork_env * +cork_env_clone_current(void); + +CORK_API void +cork_env_free(struct cork_env *env); + + +CORK_API void +cork_env_replace_current(struct cork_env *env); + + +/* For all of the following, if env is NULL, these functions access or update + * the actual environment of the current process. Otherwise, they act on the + * given environment instance. */ + +CORK_API const char * +cork_env_get(struct cork_env *env, const char *name); + +CORK_API void +cork_env_add(struct cork_env *env, const char *name, const char *value); + +CORK_API void +cork_env_add_printf(struct cork_env *env, const char *name, + const char *format, ...) + CORK_ATTR_PRINTF(3,4); + +CORK_API void +cork_env_add_vprintf(struct cork_env *env, const char *name, + const char *format, va_list args) + CORK_ATTR_PRINTF(3,0); + +CORK_API void +cork_env_remove(struct cork_env *env, const char *name); + + +/*----------------------------------------------------------------------- + * Executing another process + */ + +struct cork_exec; + +CORK_API struct cork_exec * +cork_exec_new(const char *program); + +CORK_ATTR_SENTINEL +CORK_API struct cork_exec * +cork_exec_new_with_params(const char *program, ...); + +CORK_API struct cork_exec * +cork_exec_new_with_param_array(const char *program, char * const *params); + +CORK_API void +cork_exec_free(struct cork_exec *exec); + +CORK_API const char * +cork_exec_description(struct cork_exec *exec); + +CORK_API const char * +cork_exec_program(struct cork_exec *exec); + +CORK_API size_t +cork_exec_param_count(struct cork_exec *exec); + +CORK_API const char * +cork_exec_param(struct cork_exec *exec, size_t index); + +CORK_API void +cork_exec_add_param(struct cork_exec *exec, const char *param); + +/* Can return NULL */ +CORK_API struct cork_env * +cork_exec_env(struct cork_exec *exec); + +/* Takes control of env */ +CORK_API void +cork_exec_set_env(struct cork_exec *exec, struct cork_env *env); + +/* Can return NULL */ +CORK_API const char * +cork_exec_cwd(struct cork_exec *exec); + +CORK_API void +cork_exec_set_cwd(struct cork_exec *exec, const char *directory); + +CORK_API int +cork_exec_run(struct cork_exec *exec); + + +/*----------------------------------------------------------------------- + * Subprocesses + */ + +struct cork_subprocess; + +/* If env is NULL, we use the environment variables of the calling process. */ + +/* Takes control of body */ +CORK_API struct cork_subprocess * +cork_subprocess_new(struct cork_thread_body *body, + struct cork_stream_consumer *stdout_consumer, + struct cork_stream_consumer *stderr_consumer, + int *exit_code); + +/* Takes control of exec */ +CORK_API struct cork_subprocess * +cork_subprocess_new_exec(struct cork_exec *exec, + struct cork_stream_consumer *stdout_consumer, + struct cork_stream_consumer *stderr_consumer, + int *exit_code); + +CORK_API void +cork_subprocess_free(struct cork_subprocess *sub); + +CORK_API struct cork_stream_consumer * +cork_subprocess_stdin(struct cork_subprocess *sub); + +CORK_API int +cork_subprocess_start(struct cork_subprocess *sub); + +CORK_API bool +cork_subprocess_is_finished(struct cork_subprocess *sub); + +CORK_API int +cork_subprocess_abort(struct cork_subprocess *sub); + +CORK_API bool +cork_subprocess_drain(struct cork_subprocess *sub); + +CORK_API int +cork_subprocess_wait(struct cork_subprocess *sub); + + +/*----------------------------------------------------------------------- + * Groups of subprocesses + */ + +struct cork_subprocess_group; + +CORK_API struct cork_subprocess_group * +cork_subprocess_group_new(void); + +CORK_API void +cork_subprocess_group_free(struct cork_subprocess_group *group); + +/* Takes control of sub */ +CORK_API void +cork_subprocess_group_add(struct cork_subprocess_group *group, + struct cork_subprocess *sub); + +CORK_API int +cork_subprocess_group_start(struct cork_subprocess_group *group); + +CORK_API bool +cork_subprocess_group_is_finished(struct cork_subprocess_group *group); + +CORK_API int +cork_subprocess_group_abort(struct cork_subprocess_group *group); + +CORK_API bool +cork_subprocess_group_drain(struct cork_subprocess_group *group); + +CORK_API int +cork_subprocess_group_wait(struct cork_subprocess_group *group); + + +#endif /* LIBCORK_OS_SUBPROCESS_H */ diff --git a/libcork/include/libcork/threads.h b/libcork/include/libcork/threads.h new file mode 100644 index 00000000..c0084191 --- /dev/null +++ b/libcork/include/libcork/threads.h @@ -0,0 +1,19 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_THREADS_H +#define LIBCORK_THREADS_H + +/*** include all of the parts ***/ + +#include +#include + +#endif /* LIBCORK_THREADS_H */ diff --git a/libcork/include/libcork/threads/atomics.h b/libcork/include/libcork/threads/atomics.h new file mode 100644 index 00000000..e1cc04d1 --- /dev/null +++ b/libcork/include/libcork/threads/atomics.h @@ -0,0 +1,45 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_THREADS_ATOMICS_H +#define LIBCORK_THREADS_ATOMICS_H + +#include +#include + +/*----------------------------------------------------------------------- + * GCC intrinsics + */ + +/* Ideally we can use GCC's intrinsics to define everything */ +#if defined(CORK_CONFIG_HAVE_GCC_ATOMICS) + +#define cork_int_atomic_add __sync_add_and_fetch +#define cork_uint_atomic_add __sync_add_and_fetch +#define cork_int_atomic_pre_add __sync_fetch_and_add +#define cork_uint_atomic_pre_add __sync_fetch_and_add +#define cork_int_atomic_sub __sync_sub_and_fetch +#define cork_uint_atomic_sub __sync_sub_and_fetch +#define cork_int_atomic_pre_sub __sync_fetch_and_sub +#define cork_uint_atomic_pre_sub __sync_fetch_and_sub +#define cork_int_cas __sync_val_compare_and_swap +#define cork_uint_cas __sync_val_compare_and_swap +#define cork_ptr_cas __sync_val_compare_and_swap + + +/*----------------------------------------------------------------------- + * End of atomic implementations + */ +#else +#error "No atomics implementation!" +#endif + + +#endif /* LIBCORK_THREADS_ATOMICS_H */ diff --git a/libcork/include/libcork/threads/basics.h b/libcork/include/libcork/threads/basics.h new file mode 100644 index 00000000..d5fef91c --- /dev/null +++ b/libcork/include/libcork/threads/basics.h @@ -0,0 +1,216 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef LIBCORK_THREADS_BASICS_H +#define LIBCORK_THREADS_BASICS_H + +#include + +#include +#include +#include + + +/*----------------------------------------------------------------------- + * Thread IDs + */ + +typedef unsigned int cork_thread_id; + +#define CORK_THREAD_NONE ((cork_thread_id) 0) + +/* Returns a valid ID for any thread — even the main thread and threads that + * aren't created by libcork. */ +CORK_API cork_thread_id +cork_current_thread_get_id(void); + + +/*----------------------------------------------------------------------- + * Main functions + */ + +struct cork_thread_body { + int + (*run)(struct cork_thread_body *self); + + void + (*free)(struct cork_thread_body *self); +}; + +#define cork_thread_body_run(tb) ((tb)->run((tb))) +#define cork_thread_body_free(tb) ((tb)->free((tb))) + + +/*----------------------------------------------------------------------- + * Threads + */ + +struct cork_thread; + +/* Returns NULL for the main thread, and for any thread not created via + * cork_thread_new/cork_thread_start. */ +CORK_API struct cork_thread * +cork_current_thread_get(void); + +CORK_API struct cork_thread * +cork_thread_new(const char *name, struct cork_thread_body *body); + +/* Thread must not have been started yet. */ +CORK_API void +cork_thread_free(struct cork_thread *thread); + +CORK_API const char * +cork_thread_get_name(struct cork_thread *thread); + +CORK_API cork_thread_id +cork_thread_get_id(struct cork_thread *thread); + +/* Can only be called once per thread. Thread will automatically be freed when + * its done. */ +CORK_API int +cork_thread_start(struct cork_thread *thread); + +/* Can only be called once per thread; must be called after cork_thread_start. */ +CORK_API int +cork_thread_join(struct cork_thread *thread); + + +/*----------------------------------------------------------------------- + * Executing something once + */ + +#if CORK_CONFIG_HAVE_GCC_ASM && (CORK_CONFIG_ARCH_X86 || CORK_CONFIG_ARCH_X64) +#define cork_pause() \ + do { \ + __asm__ __volatile__ ("pause"); \ + } while (0) +#else +#define cork_pause() do { /* do nothing */ } while (0) +#endif + + +#define cork_once_barrier(name) \ + static struct { \ + volatile int barrier; \ + cork_thread_id initializing_thread; \ + } name##__once; + +#define cork_once(name, call) \ + do { \ + if (CORK_LIKELY(name##__once.barrier == 2)) { \ + /* already initialized */ \ + } else { \ + /* Try to claim the ability to perform the initialization */ \ + int prior_state = cork_int_cas(&name##__once.barrier, 0, 1); \ + if (CORK_LIKELY(prior_state == 0)) { \ + CORK_ATTR_UNUSED int result; \ + /* we get to initialize */ \ + call; \ + result = cork_int_cas(&name##__once.barrier, 1, 2); \ + assert(result == 1); \ + } else { \ + /* someone else is initializing, spin/wait until done */ \ + while (name##__once.barrier != 2) { cork_pause(); } \ + } \ + } \ + } while (0) + +#define cork_once_recursive(name, call) \ + do { \ + if (CORK_LIKELY(name##__once.barrier == 2)) { \ + /* already initialized */ \ + } else { \ + /* Try to claim the ability to perform the initialization */ \ + int prior_state = cork_int_cas(&name##__once.barrier, 0, 1); \ + if (CORK_LIKELY(prior_state == 0)) { \ + CORK_ATTR_UNUSED int result; \ + /* we get to initialize */ \ + name##__once.initializing_thread = \ + cork_current_thread_get_id(); \ + call; \ + result = cork_int_cas(&name##__once.barrier, 1, 2); \ + assert(result == 1); \ + } else { \ + /* someone else is initializing, is it us? */ \ + if (name##__once.initializing_thread == \ + cork_current_thread_get_id()) { \ + /* yep, fall through to let our recursion continue */ \ + } else { \ + /* nope; wait for the initialization to finish */ \ + while (name##__once.barrier != 2) { cork_pause(); } \ + } \ + } \ + } \ + } while (0) + + +/*----------------------------------------------------------------------- + * Thread-local storage + */ + +/* Prefer, in order: + * + * 1) __thread storage class + * 2) pthread_key_t + */ + +#if CORK_CONFIG_HAVE_THREAD_STORAGE_CLASS +#define cork_tls(TYPE, NAME) \ +static __thread TYPE NAME##__tls; \ +\ +static TYPE * \ +NAME##_get(void) \ +{ \ + return &NAME##__tls; \ +} + +#elif CORK_HAVE_PTHREADS +#include +#include + +#include + +#define cork_tls(TYPE, NAME) \ +static pthread_key_t NAME##__tls_key; \ +cork_once_barrier(NAME##__tls_barrier); \ +\ +static void \ +NAME##__tls_destroy(void *vself) \ +{ \ + free(vself); \ +} \ +\ +static void \ +NAME##__create_key(void) \ +{ \ + CORK_ATTR_UNUSED int rc; \ + rc = pthread_key_create(&NAME##__tls_key, &NAME##__tls_destroy); \ + assert(rc == 0); \ +} \ +\ +static TYPE * \ +NAME##_get(void) \ +{ \ + TYPE *self; \ + cork_once(NAME##__tls_barrier, NAME##__create_key()); \ + self = pthread_getspecific(NAME##__tls_key); \ + if (CORK_UNLIKELY(self == NULL)) { \ + self = cork_calloc(1, sizeof(TYPE)); \ + pthread_setspecific(NAME##__tls_key, self); \ + } \ + return self; \ +} + +#else +#error "No thread-local storage implementation!" +#endif + + +#endif /* LIBCORK_THREADS_BASICS_H */ diff --git a/libcork/posix/.dirstamp b/libcork/posix/.dirstamp new file mode 100644 index 00000000..e69de29b diff --git a/libcork/posix/directory-walker.c b/libcork/posix/directory-walker.c new file mode 100644 index 00000000..c5a25c5d --- /dev/null +++ b/libcork/posix/directory-walker.c @@ -0,0 +1,122 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "libcork/core/attributes.h" +#include "libcork/core/error.h" +#include "libcork/core/types.h" +#include "libcork/ds/buffer.h" +#include "libcork/helpers/errors.h" +#include "libcork/helpers/posix.h" +#include "libcork/os/files.h" + + +static int +cork_walk_one_directory(struct cork_dir_walker *w, struct cork_buffer *path, + size_t root_path_size) +{ + DIR *dir = NULL; + struct dirent *entry; + size_t dir_path_size; + + rip_check_posix(dir = opendir(path->buf)); + + cork_buffer_append(path, "/", 1); + dir_path_size = path->size; + errno = 0; + while ((entry = readdir(dir)) != NULL) { + struct stat info; + + /* Skip the "." and ".." entries */ + if (strcmp(entry->d_name, ".") == 0 || + strcmp(entry->d_name, "..") == 0) { + continue; + } + + /* Stat the directory entry */ + cork_buffer_append_string(path, entry->d_name); + ei_check_posix(stat(path->buf, &info)); + + /* If the entry is a subdirectory, recurse into it. */ + if (S_ISDIR(info.st_mode)) { + int rc = cork_dir_walker_enter_directory + (w, path->buf, path->buf + root_path_size, + path->buf + dir_path_size); + if (rc != CORK_SKIP_DIRECTORY) { + ei_check(cork_walk_one_directory(w, path, root_path_size)); + ei_check(cork_dir_walker_leave_directory + (w, path->buf, path->buf + root_path_size, + path->buf + dir_path_size)); + } + } else if (S_ISREG(info.st_mode)) { + ei_check(cork_dir_walker_file + (w, path->buf, path->buf + root_path_size, + path->buf + dir_path_size)); + } + + /* Remove this entry name from the path buffer. */ + cork_buffer_truncate(path, dir_path_size); + + /* We have to reset errno to 0 because of the ambiguous way + * readdir uses a return value of NULL. Other functions may + * return normally yet set errno to a non-zero value. dlopen + * on Mac OS X is an ogreish example. Since an error readdir + * is indicated by returning NULL and setting errno to indicate + * the error, then we need to reset it to zero before each call. + * We shall assume, perhaps to our great misery, that functions + * within this loop do proper error checking and act accordingly. + */ + errno = 0; + } + + /* Check errno immediately after the while loop terminates */ + if (CORK_UNLIKELY(errno != 0)) { + cork_system_error_set(); + goto error; + } + + /* Remove the trailing '/' from the path buffer. */ + cork_buffer_truncate(path, dir_path_size - 1); + rii_check_posix(closedir(dir)); + return 0; + +error: + if (dir != NULL) { + rii_check_posix(closedir(dir)); + } + return -1; +} + +int +cork_walk_directory(const char *path, struct cork_dir_walker *w) +{ + int rc; + char *p; + struct cork_buffer buf = CORK_BUFFER_INIT(); + + /* Seed the buffer with the directory's path, ensuring that there's no + * trailing '/' */ + cork_buffer_append_string(&buf, path); + p = buf.buf; + while (p[buf.size-1] == '/') { + buf.size--; + p[buf.size] = '\0'; + } + rc = cork_walk_one_directory(w, &buf, buf.size + 1); + cork_buffer_done(&buf); + return rc; +} diff --git a/libcork/posix/env.c b/libcork/posix/env.c new file mode 100644 index 00000000..ce4f25cb --- /dev/null +++ b/libcork/posix/env.c @@ -0,0 +1,208 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include + +#include "libcork/core.h" +#include "libcork/ds.h" +#include "libcork/os/subprocess.h" +#include "libcork/helpers/errors.h" + +#if defined(__APPLE__) +/* Apple doesn't provide access to the "environ" variable from a shared library. + * There's a workaround function to grab the environ pointer described at [1]. + * + * [1] http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man7/environ.7.html + */ +#include +#define environ (*_NSGetEnviron()) + +#else +/* On all other POSIX platforms, we assume that environ is available in shared + * libraries. */ +extern char **environ; + +#endif + + +struct cork_env_var { + const char *name; + const char *value; +}; + +static struct cork_env_var * +cork_env_var_new(const char *name, const char *value) +{ + struct cork_env_var *var = cork_new(struct cork_env_var); + var->name = cork_strdup(name); + var->value = cork_strdup(value); + return var; +} + +static void +cork_env_var_free(void *vvar) +{ + struct cork_env_var *var = vvar; + cork_strfree(var->name); + cork_strfree(var->value); + free(var); +} + + +struct cork_env { + struct cork_hash_table *variables; + struct cork_buffer buffer; +}; + +struct cork_env * +cork_env_new(void) +{ + struct cork_env *env = cork_new(struct cork_env); + env->variables = cork_string_hash_table_new(0, 0); + cork_hash_table_set_free_value(env->variables, cork_env_var_free); + cork_buffer_init(&env->buffer); + return env; +} + +static void +cork_env_add_internal(struct cork_env *env, const char *name, const char *value) +{ + if (env == NULL) { + setenv(name, value, true); + } else { + struct cork_env_var *var = cork_env_var_new(name, value); + void *old_var; + + cork_hash_table_put + (env->variables, (void *) var->name, var, NULL, NULL, &old_var); + + if (old_var != NULL) { + cork_env_var_free(old_var); + } + } +} + +struct cork_env * +cork_env_clone_current(void) +{ + char **curr; + struct cork_env *env = cork_env_new(); + + for (curr = environ; *curr != NULL; curr++) { + const char *entry = *curr; + const char *equal; + + equal = strchr(entry, '='); + if (CORK_UNLIKELY(equal == NULL)) { + /* This environment entry is malformed; skip it. */ + continue; + } + + /* Make a copy of the name so that it's NUL-terminated rather than + * equal-terminated. */ + cork_buffer_set(&env->buffer, entry, equal - entry); + cork_env_add_internal(env, env->buffer.buf, equal + 1); + } + + return env; +} + + +void +cork_env_free(struct cork_env *env) +{ + cork_hash_table_free(env->variables); + cork_buffer_done(&env->buffer); + free(env); +} + +const char * +cork_env_get(struct cork_env *env, const char *name) +{ + if (env == NULL) { + return getenv(name); + } else { + struct cork_env_var *var = + cork_hash_table_get(env->variables, (void *) name); + return (var == NULL)? NULL: var->value; + } +} + +void +cork_env_add(struct cork_env *env, const char *name, const char *value) +{ + cork_env_add_internal(env, name, value); +} + +void +cork_env_add_vprintf(struct cork_env *env, const char *name, + const char *format, va_list args) +{ + cork_buffer_vprintf(&env->buffer, format, args); + cork_env_add_internal(env, name, env->buffer.buf); +} + +void +cork_env_add_printf(struct cork_env *env, const char *name, + const char *format, ...) +{ + va_list args; + va_start(args, format); + cork_env_add_vprintf(env, name, format, args); + va_end(args); +} + +void +cork_env_remove(struct cork_env *env, const char *name) +{ + if (env == NULL) { + unsetenv(name); + } else { + void *old_var; + cork_hash_table_delete(env->variables, (void *) name, NULL, &old_var); + if (old_var != NULL) { + cork_env_var_free(old_var); + } + } +} + + +static enum cork_hash_table_map_result +cork_env_set_vars(void *user_data, struct cork_hash_table_entry *entry) +{ + struct cork_env_var *var = entry->value; + setenv(var->name, var->value, false); + return CORK_HASH_TABLE_MAP_CONTINUE; +} + +#if defined(__APPLE__) || (defined(BSD) && (BSD >= 199103)) +/* A handful of platforms [1] don't provide clearenv(), so we must implement our + * own version that clears the environ array directly. + * + * [1] http://www.gnu.org/software/gnulib/manual/html_node/clearenv.html + */ +static void +clearenv(void) +{ + *environ = NULL; +} + +#else +/* Otherwise assume that we have clearenv available. */ +#endif + +void +cork_env_replace_current(struct cork_env *env) +{ + clearenv(); + cork_hash_table_map(env->variables, NULL, cork_env_set_vars); +} diff --git a/libcork/posix/exec.c b/libcork/posix/exec.c new file mode 100644 index 00000000..66fd2159 --- /dev/null +++ b/libcork/posix/exec.c @@ -0,0 +1,190 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include + +#include "libcork/core.h" +#include "libcork/ds.h" +#include "libcork/os/subprocess.h" +#include "libcork/helpers/errors.h" + +#define ri_check_posix(call) \ + do { \ + while (true) { \ + if ((call) == -1) { \ + if (errno == EINTR) { \ + continue; \ + } else { \ + cork_system_error_set(); \ + CORK_PRINT_ERROR(); \ + return -1; \ + } \ + } else { \ + break; \ + } \ + } \ + } while (0) + + +struct cork_exec { + const char *program; + struct cork_string_array params; + struct cork_env *env; + const char *cwd; + struct cork_buffer description; +}; + +struct cork_exec * +cork_exec_new(const char *program) +{ + struct cork_exec *exec = cork_new(struct cork_exec); + exec->program = cork_strdup(program); + cork_string_array_init(&exec->params); + exec->env = NULL; + exec->cwd = NULL; + cork_buffer_init(&exec->description); + cork_buffer_set_string(&exec->description, program); + return exec; +} + +struct cork_exec * +cork_exec_new_with_params(const char *program, ...) +{ + struct cork_exec *exec; + va_list args; + const char *param; + + exec = cork_exec_new(program); + cork_exec_add_param(exec, program); + va_start(args, program); + while ((param = va_arg(args, const char *)) != NULL) { + cork_exec_add_param(exec, param); + } + return exec; +} + +struct cork_exec * +cork_exec_new_with_param_array(const char *program, char * const *params) +{ + char * const *curr; + struct cork_exec *exec = cork_exec_new(program); + for (curr = params; *curr != NULL; curr++) { + cork_exec_add_param(exec, *curr); + } + return exec; +} + +void +cork_exec_free(struct cork_exec *exec) +{ + cork_strfree(exec->program); + cork_array_done(&exec->params); + if (exec->env != NULL) { + cork_env_free(exec->env); + } + if (exec->cwd != NULL) { + cork_strfree(exec->cwd); + } + cork_buffer_done(&exec->description); + free(exec); +} + +const char * +cork_exec_description(struct cork_exec *exec) +{ + return exec->description.buf; +} + +const char * +cork_exec_program(struct cork_exec *exec) +{ + return exec->program; +} + +size_t +cork_exec_param_count(struct cork_exec *exec) +{ + return cork_array_size(&exec->params); +} + +const char * +cork_exec_param(struct cork_exec *exec, size_t index) +{ + return cork_array_at(&exec->params, index); +} + +void +cork_exec_add_param(struct cork_exec *exec, const char *param) +{ + /* Don't add the first parameter to the description; that's a copy of the + * program name, which we've already added. */ + if (!cork_array_is_empty(&exec->params)) { + cork_buffer_append(&exec->description, " ", 1); + cork_buffer_append_string(&exec->description, param); + } + cork_array_append(&exec->params, cork_strdup(param)); +} + +struct cork_env * +cork_exec_env(struct cork_exec *exec) +{ + return exec->env; +} + +void +cork_exec_set_env(struct cork_exec *exec, struct cork_env *env) +{ + if (exec->env != NULL) { + cork_env_free(exec->env); + } + exec->env = env; +} + +const char * +cork_exec_cwd(struct cork_exec *exec) +{ + return exec->cwd; +} + +void +cork_exec_set_cwd(struct cork_exec *exec, const char *directory) +{ + if (exec->cwd != NULL) { + cork_strfree(exec->cwd); + } + exec->cwd = cork_strdup(directory); +} + +int +cork_exec_run(struct cork_exec *exec) +{ + const char **params; + + /* Make sure the parameter array is NULL-terminated. */ + cork_array_append(&exec->params, NULL); + params = cork_array_elements(&exec->params); + + /* Fill in the requested environment */ + if (exec->env != NULL) { + cork_env_replace_current(exec->env); + } + + /* Change the working directory, if requested */ + if (exec->cwd != NULL) { + ri_check_posix(chdir(exec->cwd)); + } + + /* Execute the new program */ + ri_check_posix(execvp(exec->program, (char * const *) params)); + + /* This is unreachable */ + return 0; +} diff --git a/libcork/posix/files.c b/libcork/posix/files.c new file mode 100644 index 00000000..7a4a2ad9 --- /dev/null +++ b/libcork/posix/files.c @@ -0,0 +1,872 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libcork/core/attributes.h" +#include "libcork/core/error.h" +#include "libcork/core/types.h" +#include "libcork/ds/array.h" +#include "libcork/ds/buffer.h" +#include "libcork/helpers/errors.h" +#include "libcork/helpers/posix.h" +#include "libcork/os/files.h" +#include "libcork/os/subprocess.h" + + +#if !defined(CORK_DEBUG_FILES) +#define CORK_DEBUG_FILES 0 +#endif + +#if CORK_DEBUG_FILES +#include +#define DEBUG(...) fprintf(stderr, __VA_ARGS__) +#else +#define DEBUG(...) /* no debug messages */ +#endif + + +/*----------------------------------------------------------------------- + * Paths + */ + +struct cork_path { + struct cork_buffer given; +}; + +static struct cork_path * +cork_path_new_internal(const char *str, size_t length) +{ + struct cork_path *path = cork_new(struct cork_path); + cork_buffer_init(&path->given); + if (length == 0) { + cork_buffer_ensure_size(&path->given, 16); + cork_buffer_set(&path->given, "", 0); + } else { + cork_buffer_set(&path->given, str, length); + } + return path; +} + +struct cork_path * +cork_path_new(const char *source) +{ + return cork_path_new_internal(source, source == NULL? 0: strlen(source)); +} + +struct cork_path * +cork_path_clone(const struct cork_path *other) +{ + return cork_path_new_internal(other->given.buf, other->given.size); +} + +void +cork_path_free(struct cork_path *path) +{ + cork_buffer_done(&path->given); + free(path); +} + + +void +cork_path_set(struct cork_path *path, const char *content) +{ + if (content == NULL) { + cork_buffer_clear(&path->given); + } else { + cork_buffer_set_string(&path->given, content); + } +} + +const char * +cork_path_get(const struct cork_path *path) +{ + return path->given.buf; +} + +#define cork_path_get(path) ((const char *) (path)->given.buf) +#define cork_path_size(path) ((path)->given.size) +#define cork_path_truncate(path, size) \ + (cork_buffer_truncate(&(path)->given, (size))) + + +int +cork_path_set_cwd(struct cork_path *path) +{ + cork_buffer_ensure_size(&path->given, PATH_MAX); + rip_check_posix(getcwd(path->given.buf, PATH_MAX)); + path->given.size = strlen(path->given.buf); + return 0; +} + +struct cork_path * +cork_path_cwd(void) +{ + struct cork_path *path = cork_path_new(NULL); + ei_check(cork_path_set_cwd(path)); + return path; + +error: + cork_path_free(path); + return NULL; +} + + +int +cork_path_set_absolute(struct cork_path *path) +{ + struct cork_buffer buf; + + if (path->given.size > 0 && + cork_buffer_char(&path->given, path->given.size - 1) == '/') { + /* The path is already absolute */ + return 0; + } + + cork_buffer_init(&buf); + cork_buffer_ensure_size(&buf, PATH_MAX); + ep_check_posix(getcwd(buf.buf, PATH_MAX)); + buf.size = strlen(buf.buf); + cork_buffer_append(&buf, "/", 1); + cork_buffer_append_copy(&buf, &path->given); + cork_buffer_done(&path->given); + path->given = buf; + return 0; + +error: + cork_buffer_done(&buf); + return -1; +} + +struct cork_path * +cork_path_absolute(const struct cork_path *other) +{ + struct cork_path *path = cork_path_clone(other); + ei_check(cork_path_set_absolute(path)); + return path; + +error: + cork_path_free(path); + return NULL; +} + + +void +cork_path_append(struct cork_path *path, const char *more) +{ + if (more == NULL || more[0] == '\0') { + return; + } + + if (more[0] == '/') { + /* If more starts with a "/", then its absolute, and should replace the + * contents of the current path. */ + cork_buffer_set_string(&path->given, more); + } else { + /* Otherwise, more is relative, and should be appended to the current + * path. If the current given path doesn't end in a "/", then we need + * to add one to keep the path well-formed. */ + + if (path->given.size > 0 && + cork_buffer_char(&path->given, path->given.size - 1) != '/') { + cork_buffer_append(&path->given, "/", 1); + } + + cork_buffer_append_string(&path->given, more); + } +} + +struct cork_path * +cork_path_join(const struct cork_path *other, const char *more) +{ + struct cork_path *path = cork_path_clone(other); + cork_path_append(path, more); + return path; +} + +void +cork_path_append_path(struct cork_path *path, const struct cork_path *more) +{ + cork_path_append(path, more->given.buf); +} + +struct cork_path * +cork_path_join_path(const struct cork_path *other, const struct cork_path *more) +{ + struct cork_path *path = cork_path_clone(other); + cork_path_append_path(path, more); + return path; +} + + +void +cork_path_set_basename(struct cork_path *path) +{ + char *given = path->given.buf; + const char *last_slash = strrchr(given, '/'); + if (last_slash != NULL) { + size_t offset = last_slash - given; + size_t basename_length = path->given.size - offset - 1; + memmove(given, last_slash + 1, basename_length); + given[basename_length] = '\0'; + path->given.size = basename_length; + } +} + +struct cork_path * +cork_path_basename(const struct cork_path *other) +{ + struct cork_path *path = cork_path_clone(other); + cork_path_set_basename(path); + return path; +} + + +void +cork_path_set_dirname(struct cork_path *path) +{ + const char *given = path->given.buf; + const char *last_slash = strrchr(given, '/'); + if (last_slash == NULL) { + cork_buffer_clear(&path->given); + } else { + size_t offset = last_slash - given; + if (offset == 0) { + /* A special case for the immediate subdirectories of "/" */ + cork_buffer_truncate(&path->given, 1); + } else { + cork_buffer_truncate(&path->given, offset); + } + } +} + +struct cork_path * +cork_path_dirname(const struct cork_path *other) +{ + struct cork_path *path = cork_path_clone(other); + cork_path_set_dirname(path); + return path; +} + + +/*----------------------------------------------------------------------- + * Lists of paths + */ + +struct cork_path_list { + cork_array(struct cork_path *) array; + struct cork_buffer string; +}; + +struct cork_path_list * +cork_path_list_new_empty(void) +{ + struct cork_path_list *list = cork_new(struct cork_path_list); + cork_array_init(&list->array); + cork_buffer_init(&list->string); + return list; +} + +void +cork_path_list_free(struct cork_path_list *list) +{ + size_t i; + for (i = 0; i < cork_array_size(&list->array); i++) { + struct cork_path *path = cork_array_at(&list->array, i); + cork_path_free(path); + } + cork_array_done(&list->array); + cork_buffer_done(&list->string); + free(list); +} + +const char * +cork_path_list_to_string(const struct cork_path_list *list) +{ + return list->string.buf; +} + +void +cork_path_list_add(struct cork_path_list *list, struct cork_path *path) +{ + cork_array_append(&list->array, path); + if (cork_array_size(&list->array) > 1) { + cork_buffer_append(&list->string, ":", 1); + } + cork_buffer_append_string(&list->string, cork_path_get(path)); +} + +size_t +cork_path_list_size(const struct cork_path_list *list) +{ + return cork_array_size(&list->array); +} + +const struct cork_path * +cork_path_list_get(const struct cork_path_list *list, size_t index) +{ + return cork_array_at(&list->array, index); +} + +static void +cork_path_list_append_string(struct cork_path_list *list, const char *str) +{ + struct cork_path *path; + const char *curr = str; + const char *next; + + while ((next = strchr(curr, ':')) != NULL) { + size_t size = next - curr; + path = cork_path_new_internal(curr, size); + cork_path_list_add(list, path); + curr = next + 1; + } + + path = cork_path_new(curr); + cork_path_list_add(list, path); +} + +struct cork_path_list * +cork_path_list_new(const char *str) +{ + struct cork_path_list *list = cork_path_list_new_empty(); + cork_path_list_append_string(list, str); + return list; +} + + +/*----------------------------------------------------------------------- + * Files + */ + +struct cork_file { + struct cork_path *path; + struct stat stat; + enum cork_file_type type; + bool has_stat; +}; + +static void +cork_file_init(struct cork_file *file, struct cork_path *path) +{ + file->path = path; + file->has_stat = false; +} + +struct cork_file * +cork_file_new(const char *path) +{ + return cork_file_new_from_path(cork_path_new(path)); +} + +struct cork_file * +cork_file_new_from_path(struct cork_path *path) +{ + struct cork_file *file = cork_new(struct cork_file); + cork_file_init(file, path); + return file; +} + +static void +cork_file_reset(struct cork_file *file) +{ + file->has_stat = false; +} + +static void +cork_file_done(struct cork_file *file) +{ + cork_path_free(file->path); +} + +void +cork_file_free(struct cork_file *file) +{ + cork_file_done(file); + free(file); +} + +const struct cork_path * +cork_file_path(struct cork_file *file) +{ + return file->path; +} + +static int +cork_file_stat(struct cork_file *file) +{ + if (file->has_stat) { + return 0; + } else { + int rc; + rc = stat(cork_path_get(file->path), &file->stat); + + if (rc == -1) { + if (errno == ENOENT || errno == ENOTDIR) { + file->type = CORK_FILE_MISSING; + file->has_stat = true; + return 0; + } else { + cork_system_error_set(); + return -1; + } + } + + if (S_ISREG(file->stat.st_mode)) { + file->type = CORK_FILE_REGULAR; + } else if (S_ISDIR(file->stat.st_mode)) { + file->type = CORK_FILE_DIRECTORY; + } else if (S_ISLNK(file->stat.st_mode)) { + file->type = CORK_FILE_SYMLINK; + } else { + file->type = CORK_FILE_UNKNOWN; + } + + file->has_stat = true; + return 0; + } +} + +int +cork_file_exists(struct cork_file *file, bool *exists) +{ + rii_check(cork_file_stat(file)); + *exists = (file->type != CORK_FILE_MISSING); + return 0; +} + +int +cork_file_type(struct cork_file *file, enum cork_file_type *type) +{ + rii_check(cork_file_stat(file)); + *type = file->type; + return 0; +} + + +struct cork_file * +cork_path_list_find_file(const struct cork_path_list *list, + const char *rel_path) +{ + size_t i; + size_t count = cork_path_list_size(list); + struct cork_file *file; + + for (i = 0; i < count; i++) { + const struct cork_path *path = cork_path_list_get(list, i); + struct cork_path *joined = cork_path_join(path, rel_path); + bool exists; + file = cork_file_new_from_path(joined); + ei_check(cork_file_exists(file, &exists)); + if (exists) { + return file; + } else { + cork_file_free(file); + } + } + + cork_error_set_printf + (ENOENT, "%s not found in %s", + rel_path, cork_path_list_to_string(list)); + return NULL; + +error: + cork_file_free(file); + return NULL; +} + + +/*----------------------------------------------------------------------- + * Directories + */ + +int +cork_file_iterate_directory(struct cork_file *file, + cork_file_directory_iterator iterator, + void *user_data) +{ + DIR *dir = NULL; + struct dirent *entry; + size_t dir_path_size; + struct cork_path *child_path; + struct cork_file child_file; + + rip_check_posix(dir = opendir(cork_path_get(file->path))); + child_path = cork_path_clone(file->path); + cork_file_init(&child_file, child_path); + dir_path_size = cork_path_size(child_path); + + errno = 0; + while ((entry = readdir(dir)) != NULL) { + /* Skip the "." and ".." entries */ + if (strcmp(entry->d_name, ".") == 0 || + strcmp(entry->d_name, "..") == 0) { + continue; + } + + cork_path_append(child_path, entry->d_name); + ei_check(cork_file_stat(&child_file)); + + /* If the entry is a subdirectory, recurse into it. */ + ei_check(iterator(&child_file, entry->d_name, user_data)); + + /* Remove this entry name from the path buffer. */ + cork_path_truncate(child_path, dir_path_size); + cork_file_reset(&child_file); + + /* We have to reset errno to 0 because of the ambiguous way readdir uses + * a return value of NULL. Other functions may return normally yet set + * errno to a non-zero value. dlopen on Mac OS X is an ogreish example. + * Since an error readdir is indicated by returning NULL and setting + * errno to indicate the error, then we need to reset it to zero before + * each call. We shall assume, perhaps to our great misery, that + * functions within this loop do proper error checking and act + * accordingly. */ + errno = 0; + } + + /* Check errno immediately after the while loop terminates */ + if (CORK_UNLIKELY(errno != 0)) { + cork_system_error_set(); + goto error; + } + + cork_file_done(&child_file); + rii_check_posix(closedir(dir)); + return 0; + +error: + cork_file_done(&child_file); + rii_check_posix(closedir(dir)); + return -1; +} + +static int +cork_file_mkdir_one(struct cork_file *file, cork_file_mode mode, + unsigned int flags) +{ + DEBUG("mkdir %s\n", cork_path_get(file->path)); + + /* First check if the directory already exists. */ + rii_check(cork_file_stat(file)); + if (file->type == CORK_FILE_DIRECTORY) { + DEBUG(" Already exists!\n"); + if (!(flags & CORK_FILE_PERMISSIVE)) { + cork_system_error_set_explicit(EEXIST); + return -1; + } else { + return 0; + } + } else if (file->type != CORK_FILE_MISSING) { + DEBUG(" Exists and not a directory!\n"); + cork_system_error_set_explicit(EEXIST); + return -1; + } + + /* If the caller asked for a recursive mkdir, then make sure the parent + * directory exists. */ + if (flags & CORK_FILE_RECURSIVE) { + struct cork_path *parent = cork_path_dirname(file->path); + DEBUG(" Checking parent %s\n", cork_path_get(parent)); + if (parent->given.size == 0) { + /* There is no parent; we're either at the filesystem root (for an + * absolute path) or the current directory (for a relative one). + * Either way, we can assume it already exists. */ + cork_path_free(parent); + } else { + int rc; + struct cork_file parent_file; + cork_file_init(&parent_file, parent); + rc = cork_file_mkdir_one + (&parent_file, mode, flags | CORK_FILE_PERMISSIVE); + cork_file_done(&parent_file); + rii_check(rc); + } + } + + /* Create the directory already! */ + DEBUG(" Creating %s\n", cork_path_get(file->path)); + rii_check_posix(mkdir(cork_path_get(file->path), mode)); + return 0; +} + +int +cork_file_mkdir(struct cork_file *file, cork_file_mode mode, + unsigned int flags) +{ + return cork_file_mkdir_one(file, mode, flags); +} + +static int +cork_file_remove_iterator(struct cork_file *file, const char *rel_name, + void *user_data) +{ + unsigned int *flags = user_data; + return cork_file_remove(file, *flags); +} + +int +cork_file_remove(struct cork_file *file, unsigned int flags) +{ + DEBUG("rm %s\n", cork_path_get(file->path)); + rii_check(cork_file_stat(file)); + + if (file->type == CORK_FILE_MISSING) { + if (flags & CORK_FILE_PERMISSIVE) { + return 0; + } else { + cork_system_error_set_explicit(ENOENT); + return -1; + } + } else if (file->type == CORK_FILE_DIRECTORY) { + if (flags & CORK_FILE_RECURSIVE) { + /* The user asked that we delete the contents of the directory + * first. */ + rii_check(cork_file_iterate_directory + (file, cork_file_remove_iterator, &flags)); + } + + rii_check_posix(rmdir(cork_path_get(file->path))); + return 0; + } else { + rii_check(unlink(cork_path_get(file->path))); + return 0; + } +} + + +/*----------------------------------------------------------------------- + * Lists of files + */ + +struct cork_file_list { + cork_array(struct cork_file *) array; +}; + +struct cork_file_list * +cork_file_list_new_empty(void) +{ + struct cork_file_list *list = cork_new(struct cork_file_list); + cork_array_init(&list->array); + return list; +} + +void +cork_file_list_free(struct cork_file_list *list) +{ + size_t i; + for (i = 0; i < cork_array_size(&list->array); i++) { + struct cork_file *file = cork_array_at(&list->array, i); + cork_file_free(file); + } + cork_array_done(&list->array); + free(list); +} + +void +cork_file_list_add(struct cork_file_list *list, struct cork_file *file) +{ + cork_array_append(&list->array, file); +} + +size_t +cork_file_list_size(struct cork_file_list *list) +{ + return cork_array_size(&list->array); +} + +struct cork_file * +cork_file_list_get(struct cork_file_list *list, size_t index) +{ + return cork_array_at(&list->array, index); +} + +struct cork_file_list * +cork_file_list_new(struct cork_path_list *path_list) +{ + struct cork_file_list *list = cork_file_list_new_empty(); + size_t count = cork_path_list_size(path_list); + size_t i; + + for (i = 0; i < count; i++) { + const struct cork_path *path = cork_path_list_get(path_list, i); + struct cork_file *file = cork_file_new(cork_path_get(path)); + cork_array_append(&list->array, file); + } + + return list; +} + + +struct cork_file_list * +cork_path_list_find_files(const struct cork_path_list *path_list, + const char *rel_path) +{ + size_t i; + size_t count = cork_path_list_size(path_list); + struct cork_file_list *list = cork_file_list_new_empty(); + struct cork_file *file; + + for (i = 0; i < count; i++) { + const struct cork_path *path = cork_path_list_get(path_list, i); + struct cork_path *joined = cork_path_join(path, rel_path); + bool exists; + file = cork_file_new_from_path(joined); + ei_check(cork_file_exists(file, &exists)); + if (exists) { + cork_file_list_add(list, file); + } else { + cork_file_free(file); + } + } + + return list; + +error: + cork_file_list_free(list); + cork_file_free(file); + return NULL; +} + + +/*----------------------------------------------------------------------- + * Standard paths and path lists + */ + +#define empty_string(str) ((str) == NULL || (str)[0] == '\0') + +struct cork_path * +cork_path_home(void) +{ + const char *path = cork_env_get(NULL, "HOME"); + if (empty_string(path)) { + cork_undefined("Cannot determine home directory"); + return NULL; + } else { + return cork_path_new(path); + } +} + + +struct cork_path_list * +cork_path_config_paths(void) +{ + struct cork_path_list *list = cork_path_list_new_empty(); + const char *var; + struct cork_path *path; + + /* The first entry should be the user's configuration directory. This is + * specified by $XDG_CONFIG_HOME, with $HOME/.config as the default. */ + var = cork_env_get(NULL, "XDG_CONFIG_HOME"); + if (empty_string(var)) { + ep_check(path = cork_path_home()); + cork_path_append(path, ".config"); + cork_path_list_add(list, path); + } else { + path = cork_path_new(var); + cork_path_list_add(list, path); + } + + /* The remaining entries should be the system-wide configuration + * directories. These are specified by $XDG_CONFIG_DIRS, with /etc/xdg as + * the default. */ + var = cork_env_get(NULL, "XDG_CONFIG_DIRS"); + if (empty_string(var)) { + path = cork_path_new("/etc/xdg"); + cork_path_list_add(list, path); + } else { + cork_path_list_append_string(list, var); + } + + return list; + +error: + cork_path_list_free(list); + return NULL; +} + +struct cork_path_list * +cork_path_data_paths(void) +{ + struct cork_path_list *list = cork_path_list_new_empty(); + const char *var; + struct cork_path *path; + + /* The first entry should be the user's data directory. This is specified + * by $XDG_DATA_HOME, with $HOME/.local/share as the default. */ + var = cork_env_get(NULL, "XDG_DATA_HOME"); + if (empty_string(var)) { + ep_check(path = cork_path_home()); + cork_path_append(path, ".local/share"); + cork_path_list_add(list, path); + } else { + path = cork_path_new(var); + cork_path_list_add(list, path); + } + + /* The remaining entries should be the system-wide configuration + * directories. These are specified by $XDG_DATA_DIRS, with + * /usr/local/share:/usr/share as the the default. */ + var = cork_env_get(NULL, "XDG_DATA_DIRS"); + if (empty_string(var)) { + path = cork_path_new("/usr/local/share"); + cork_path_list_add(list, path); + path = cork_path_new("/usr/share"); + cork_path_list_add(list, path); + } else { + cork_path_list_append_string(list, var); + } + + return list; + +error: + cork_path_list_free(list); + return NULL; +} + +struct cork_path * +cork_path_user_cache_path(void) +{ + const char *var; + struct cork_path *path; + + /* The user's cache directory is specified by $XDG_CACHE_HOME, with + * $HOME/.cache as the default. */ + var = cork_env_get(NULL, "XDG_CACHE_HOME"); + if (empty_string(var)) { + rpp_check(path = cork_path_home()); + cork_path_append(path, ".cache"); + return path; + } else { + return cork_path_new(var); + } +} + +struct cork_path * +cork_path_user_runtime_path(void) +{ + const char *var; + + /* The user's cache directory is specified by $XDG_RUNTIME_DIR, with + * no default given by the spec. */ + var = cork_env_get(NULL, "XDG_RUNTIME_DIR"); + if (empty_string(var)) { + cork_undefined("Cannot determine user-specific runtime directory"); + return NULL; + } else { + return cork_path_new(var); + } +} diff --git a/libcork/posix/process.c b/libcork/posix/process.c new file mode 100644 index 00000000..e22e1668 --- /dev/null +++ b/libcork/posix/process.c @@ -0,0 +1,111 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "libcork/core.h" +#include "libcork/ds.h" +#include "libcork/os/process.h" +#include "libcork/helpers/errors.h" + + +#if !defined(CORK_DEBUG_PROCESS) +#define CORK_DEBUG_PROCESS 0 +#endif + +#if CORK_DEBUG_PROCESS +#include +#define DEBUG(...) fprintf(stderr, __VA_ARGS__) +#else +#define DEBUG(...) /* no debug messages */ +#endif + + +struct cork_cleanup_entry { + struct cork_dllist_item item; + int priority; + const char *name; + cork_cleanup_function function; +}; + +static struct cork_cleanup_entry * +cork_cleanup_entry_new(const char *name, int priority, + cork_cleanup_function function) +{ + struct cork_cleanup_entry *self = cork_new(struct cork_cleanup_entry); + self->priority = priority; + self->name = cork_strdup(name); + self->function = function; + return self; +} + +static void +cork_cleanup_entry_free(struct cork_cleanup_entry *self) +{ + cork_strfree(self->name); + free(self); +} + +static struct cork_dllist cleanup_entries = CORK_DLLIST_INIT(cleanup_entries); + +static void +cork_cleanup_entry_add(struct cork_cleanup_entry *entry) +{ + struct cork_dllist_item *curr; + + /* Linear search through the list of existing cleanup functions. When we + * find the first existing function with a higher priority, we've found + * where to insert the new function. */ + for (curr = cork_dllist_start(&cleanup_entries); + !cork_dllist_is_end(&cleanup_entries, curr); curr = curr->next) { + struct cork_cleanup_entry *existing = + cork_container_of(curr, struct cork_cleanup_entry, item); + if (existing->priority > entry->priority) { + cork_dllist_add_before(&existing->item, &entry->item); + return; + } + } + + /* If we fall through the loop, then the new function should be appended to + * the end of the list. */ + cork_dllist_add(&cleanup_entries, &entry->item); +} + +static void +cork_cleanup_call_one(struct cork_dllist_item *item, void *user_data) +{ + struct cork_cleanup_entry *entry = + cork_container_of(item, struct cork_cleanup_entry, item); + DEBUG("Call cleanup function [%d] %s\n", entry->priority, entry->name); + entry->function(); + cork_cleanup_entry_free(entry); +} + +static void +cork_cleanup_call_all(void) +{ + cork_dllist_map(&cleanup_entries, cork_cleanup_call_one, NULL); +} + + +CORK_INITIALIZER(cleanup_init) +{ + atexit(cork_cleanup_call_all); +} + +CORK_API void +cork_cleanup_at_exit_named(const char *name, int priority, + cork_cleanup_function function) +{ + struct cork_cleanup_entry *entry = + cork_cleanup_entry_new(name, priority, function); + DEBUG("Register cleanup function [%d] %s\n", priority, name); + cork_cleanup_entry_add(entry); +} diff --git a/libcork/posix/subprocess.c b/libcork/posix/subprocess.c new file mode 100644 index 00000000..a97b8043 --- /dev/null +++ b/libcork/posix/subprocess.c @@ -0,0 +1,674 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "libcork/core.h" +#include "libcork/ds.h" +#include "libcork/os/subprocess.h" +#include "libcork/threads/basics.h" +#include "libcork/helpers/errors.h" +#include "libcork/helpers/posix.h" + + +#if !defined(CORK_DEBUG_SUBPROCESS) +#define CORK_DEBUG_SUBPROCESS 0 +#endif + +#if CORK_DEBUG_SUBPROCESS +#include +#define DEBUG(...) fprintf(stderr, __VA_ARGS__) +#else +#define DEBUG(...) /* no debug messages */ +#endif + + +/*----------------------------------------------------------------------- + * Subprocess groups + */ + +#define BUF_SIZE 4096 + +struct cork_subprocess_group { + cork_array(struct cork_subprocess *) subprocesses; +}; + +struct cork_subprocess_group * +cork_subprocess_group_new(void) +{ + struct cork_subprocess_group *group = + cork_new(struct cork_subprocess_group); + cork_pointer_array_init + (&group->subprocesses, (cork_free_f) cork_subprocess_free); + return group; +} + +void +cork_subprocess_group_free(struct cork_subprocess_group *group) +{ + cork_array_done(&group->subprocesses); + free(group); +} + +void +cork_subprocess_group_add(struct cork_subprocess_group *group, + struct cork_subprocess *sub) +{ + cork_array_append(&group->subprocesses, sub); +} + + +/*----------------------------------------------------------------------- + * Pipes (parent reads) + */ + +struct cork_read_pipe { + struct cork_stream_consumer *consumer; + int fds[2]; + bool first; +}; + +static void +cork_read_pipe_init(struct cork_read_pipe *p, struct cork_stream_consumer *consumer) +{ + p->consumer = consumer; + p->fds[0] = -1; + p->fds[1] = -1; +} + +static int +cork_read_pipe_close_read(struct cork_read_pipe *p) +{ + if (p->fds[0] != -1) { + DEBUG("Closing read pipe %d\n", p->fds[0]); + rii_check_posix(close(p->fds[0])); + p->fds[0] = -1; + } + return 0; +} + +static int +cork_read_pipe_close_write(struct cork_read_pipe *p) +{ + if (p->fds[1] != -1) { + DEBUG("Closing write pipe %d\n", p->fds[1]); + rii_check_posix(close(p->fds[1])); + p->fds[1] = -1; + } + return 0; +} + +static void +cork_read_pipe_close(struct cork_read_pipe *p) +{ + cork_read_pipe_close_read(p); + cork_read_pipe_close_write(p); +} + +static void +cork_read_pipe_done(struct cork_read_pipe *p) +{ + cork_read_pipe_close(p); +} + +static int +cork_read_pipe_open(struct cork_read_pipe *p) +{ + if (p->consumer != NULL) { + int flags; + + /* We want the read end of the pipe to be non-blocking. */ + DEBUG("[read] Opening pipe\n"); + rii_check_posix(pipe(p->fds)); + DEBUG("[read] Got read=%d write=%d\n", p->fds[0], p->fds[1]); + DEBUG("[read] Setting non-blocking flag on read pipe\n"); + ei_check_posix(flags = fcntl(p->fds[0], F_GETFD)); + flags |= O_NONBLOCK; + ei_check_posix(fcntl(p->fds[0], F_SETFD, flags)); + } + + p->first = true; + return 0; + +error: + cork_read_pipe_close(p); + return -1; +} + +static int +cork_read_pipe_dup(struct cork_read_pipe *p, int fd) +{ + if (p->fds[1] != -1) { + rii_check_posix(dup2(p->fds[1], fd)); + } + return 0; +} + +static int +cork_read_pipe_read(struct cork_read_pipe *p, char *buf, bool *progress) +{ + if (p->fds[0] == -1) { + return 0; + } + + do { + DEBUG("[read] Reading from pipe %d\n", p->fds[0]); + ssize_t bytes_read = read(p->fds[0], buf, BUF_SIZE); + if (bytes_read == -1) { + if (errno == EAGAIN) { + /* We've exhausted all of the data currently available. */ + DEBUG("[read] No more bytes without blocking\n"); + return 0; + } else if (errno == EINTR) { + /* Interrupted by a signal; return so that our wait loop can + * catch that. */ + DEBUG("[read] Interrupted by signal\n"); + return 0; + } else { + /* An actual error */ + cork_system_error_set(); + DEBUG("[read] Error: %s\n", cork_error_message()); + return -1; + } + } else if (bytes_read == 0) { + DEBUG("[read] End of stream\n"); + *progress = true; + rii_check(cork_stream_consumer_eof(p->consumer)); + rii_check_posix(close(p->fds[0])); + p->fds[0] = -1; + return 0; + } else { + DEBUG("[read] Got %zd bytes\n", bytes_read); + *progress = true; + rii_check(cork_stream_consumer_data + (p->consumer, buf, bytes_read, p->first)); + p->first = false; + } + } while (true); +} + +static bool +cork_read_pipe_is_finished(struct cork_read_pipe *p) +{ + return p->fds[0] == -1; +} + + +/*----------------------------------------------------------------------- + * Pipes (parent writes) + */ + +struct cork_write_pipe { + struct cork_stream_consumer consumer; + int fds[2]; +}; + +static int +cork_write_pipe_close_read(struct cork_write_pipe *p) +{ + if (p->fds[0] != -1) { + DEBUG("[write] Closing read pipe %d\n", p->fds[0]); + rii_check_posix(close(p->fds[0])); + p->fds[0] = -1; + } + return 0; +} + +static int +cork_write_pipe_close_write(struct cork_write_pipe *p) +{ + if (p->fds[1] != -1) { + DEBUG("[write] Closing write pipe %d\n", p->fds[1]); + rii_check_posix(close(p->fds[1])); + p->fds[1] = -1; + } + return 0; +} + +static int +cork_write_pipe__data(struct cork_stream_consumer *consumer, + const void *buf, size_t size, bool is_first_chunk) +{ + struct cork_write_pipe *p = + cork_container_of(consumer, struct cork_write_pipe, consumer); + rii_check_posix(write(p->fds[1], buf, size)); + return 0; +} + +static int +cork_write_pipe__eof(struct cork_stream_consumer *consumer) +{ + struct cork_write_pipe *p = + cork_container_of(consumer, struct cork_write_pipe, consumer); + return cork_write_pipe_close_write(p); +} + +static void +cork_write_pipe__free(struct cork_stream_consumer *consumer) +{ +} + +static void +cork_write_pipe_init(struct cork_write_pipe *p) +{ + p->consumer.data = cork_write_pipe__data; + p->consumer.eof = cork_write_pipe__eof; + p->consumer.free = cork_write_pipe__free; + p->fds[0] = -1; + p->fds[1] = -1; +} + +static void +cork_write_pipe_close(struct cork_write_pipe *p) +{ + cork_write_pipe_close_read(p); + cork_write_pipe_close_write(p); +} + +static void +cork_write_pipe_done(struct cork_write_pipe *p) +{ + cork_write_pipe_close(p); +} + +static int +cork_write_pipe_open(struct cork_write_pipe *p) +{ + DEBUG("[write] Opening writer pipe\n"); + rii_check_posix(pipe(p->fds)); + DEBUG("[write] Got read=%d write=%d\n", p->fds[0], p->fds[1]); + return 0; +} + +static int +cork_write_pipe_dup(struct cork_write_pipe *p, int fd) +{ + if (p->fds[0] != -1) { + rii_check_posix(dup2(p->fds[0], fd)); + } + return 0; +} + + +/*----------------------------------------------------------------------- + * Subprocesses + */ + +struct cork_subprocess { + pid_t pid; + struct cork_write_pipe stdin_pipe; + struct cork_read_pipe stdout_pipe; + struct cork_read_pipe stderr_pipe; + struct cork_thread_body *body; + int *exit_code; + char buf[BUF_SIZE]; +}; + +struct cork_subprocess * +cork_subprocess_new(struct cork_thread_body *body, + struct cork_stream_consumer *stdout_consumer, + struct cork_stream_consumer *stderr_consumer, + int *exit_code) +{ + struct cork_subprocess *self = cork_new(struct cork_subprocess); + cork_write_pipe_init(&self->stdin_pipe); + cork_read_pipe_init(&self->stdout_pipe, stdout_consumer); + cork_read_pipe_init(&self->stderr_pipe, stderr_consumer); + self->pid = 0; + self->body = body; + self->exit_code = exit_code; + return self; +} + +void +cork_subprocess_free(struct cork_subprocess *self) +{ + cork_thread_body_free(self->body); + cork_write_pipe_done(&self->stdin_pipe); + cork_read_pipe_done(&self->stdout_pipe); + cork_read_pipe_done(&self->stderr_pipe); + free(self); +} + +struct cork_stream_consumer * +cork_subprocess_stdin(struct cork_subprocess *self) +{ + return &self->stdin_pipe.consumer; +} + + +/*----------------------------------------------------------------------- + * Executing another program + */ + +struct cork_exec_body { + struct cork_thread_body parent; + struct cork_exec *exec; +}; + +static int +cork_exec__run(struct cork_thread_body *vself) +{ + struct cork_exec_body *self = + cork_container_of(vself, struct cork_exec_body, parent); + return cork_exec_run(self->exec); +} + +static void +cork_exec__free(struct cork_thread_body *vself) +{ + struct cork_exec_body *self = + cork_container_of(vself, struct cork_exec_body, parent); + cork_exec_free(self->exec); + free(self); +} + +static struct cork_thread_body * +cork_exec_body_new(struct cork_exec *exec) +{ + struct cork_exec_body *self = cork_new(struct cork_exec_body); + self->parent.run = cork_exec__run; + self->parent.free = cork_exec__free; + self->exec = exec; + return &self->parent; +} + +struct cork_subprocess * +cork_subprocess_new_exec(struct cork_exec *exec, + struct cork_stream_consumer *out, + struct cork_stream_consumer *err, + int *exit_code) +{ + struct cork_thread_body *body = cork_exec_body_new(exec); + return cork_subprocess_new(body, out, err, exit_code); +} + + +/*----------------------------------------------------------------------- + * Running subprocesses + */ + +int +cork_subprocess_start(struct cork_subprocess *self) +{ + pid_t pid; + + /* Create the stdout and stderr pipes. */ + if (cork_write_pipe_open(&self->stdin_pipe) == -1) { + return -1; + } + if (cork_read_pipe_open(&self->stdout_pipe) == -1) { + cork_write_pipe_close(&self->stdin_pipe); + return -1; + } + if (cork_read_pipe_open(&self->stderr_pipe) == -1) { + cork_write_pipe_close(&self->stdin_pipe); + cork_read_pipe_close(&self->stdout_pipe); + return -1; + } + + /* Fork the child process. */ + DEBUG("Forking child process\n"); + pid = fork(); + if (pid == 0) { + /* Child process */ + int rc; + + /* Close the parent's end of the pipes */ + DEBUG("[child] "); + cork_write_pipe_close_write(&self->stdin_pipe); + DEBUG("[child] "); + cork_read_pipe_close_read(&self->stdout_pipe); + DEBUG("[child] "); + cork_read_pipe_close_read(&self->stderr_pipe); + + /* Bind the stdout and stderr pipes */ + if (cork_write_pipe_dup(&self->stdin_pipe, STDIN_FILENO) == -1) { + _exit(EXIT_FAILURE); + } + if (cork_read_pipe_dup(&self->stdout_pipe, STDOUT_FILENO) == -1) { + _exit(EXIT_FAILURE); + } + if (cork_read_pipe_dup(&self->stderr_pipe, STDERR_FILENO) == -1) { + _exit(EXIT_FAILURE); + } + + /* Run the subprocess's body */ + rc = cork_thread_body_run(self->body); + if (CORK_LIKELY(rc == 0)) { + _exit(EXIT_SUCCESS); + } else { + fprintf(stderr, "%s\n", cork_error_message()); + _exit(EXIT_FAILURE); + } + } else if (pid < 0) { + /* Error forking */ + cork_system_error_set(); + return -1; + } else { + /* Parent process */ + DEBUG(" Child PID=%d\n", (int) pid); + self->pid = pid; + cork_write_pipe_close_read(&self->stdin_pipe); + cork_read_pipe_close_write(&self->stdout_pipe); + cork_read_pipe_close_write(&self->stderr_pipe); + return 0; + } +} + +static int +cork_subprocess_reap(struct cork_subprocess *self, int flags, bool *progress) +{ + int pid; + int status; + rii_check_posix(pid = waitpid(self->pid, &status, flags)); + if (pid == self->pid) { + *progress = true; + self->pid = 0; + if (self->exit_code != NULL) { + *self->exit_code = WEXITSTATUS(status); + } + } + return 0; +} + +int +cork_subprocess_abort(struct cork_subprocess *self) +{ + if (self->pid > 0) { + CORK_ATTR_UNUSED bool progress; + DEBUG("Terminating child process %d\n", (int) self->pid); + kill(self->pid, SIGTERM); + return cork_subprocess_reap(self, 0, &progress); + } else { + return 0; + } +} + +bool +cork_subprocess_is_finished(struct cork_subprocess *self) +{ + return (self->pid == 0) + && cork_read_pipe_is_finished(&self->stdout_pipe) + && cork_read_pipe_is_finished(&self->stderr_pipe); +} + +#if defined(__APPLE__) +#include +#define THREAD_YIELD pthread_yield_np +#elif defined(__linux__) || defined(BSD) +#include +#define THREAD_YIELD sched_yield +#else +#error "Unknown thread yield implementation" +#endif + +static void +cork_subprocess_yield(unsigned int *spin_count) +{ + /* Adapted from + * http://www.1024cores.net/home/lock-free-algorithms/tricks/spinning */ + + if (*spin_count < 10) { + /* Spin-wait */ + cork_pause(); + } else if (*spin_count < 20) { + /* A more intense spin-wait */ + int i; + for (i = 0; i < 50; i++) { + cork_pause(); + } + } else if (*spin_count < 22) { + THREAD_YIELD(); + } else if (*spin_count < 24) { + usleep(0); + } else if (*spin_count < 50) { + usleep(1); + } else if (*spin_count < 75) { + usleep((*spin_count - 49) * 1000); + } else { + usleep(25000); + } + + (*spin_count)++; +} + +static int +cork_subprocess_drain_(struct cork_subprocess *self, bool *progress) +{ + rii_check(cork_read_pipe_read(&self->stdout_pipe, self->buf, progress)); + rii_check(cork_read_pipe_read(&self->stderr_pipe, self->buf, progress)); + if (self->pid > 0) { + return cork_subprocess_reap(self, WNOHANG, progress); + } else { + return 0; + } +} + +bool +cork_subprocess_drain(struct cork_subprocess *self) +{ + bool progress; + cork_subprocess_drain_(self, &progress); + return progress; +} + +int +cork_subprocess_wait(struct cork_subprocess *self) +{ + unsigned int spin_count = 0; + bool progress; + while (!cork_subprocess_is_finished(self)) { + progress = false; + rii_check(cork_subprocess_drain_(self, &progress)); + if (!progress) { + cork_subprocess_yield(&spin_count); + } + } + return 0; +} + + +/*----------------------------------------------------------------------- + * Running subprocess groups + */ + +static int +cork_subprocess_group_terminate(struct cork_subprocess_group *group) +{ + size_t i; + for (i = 0; i < cork_array_size(&group->subprocesses); i++) { + struct cork_subprocess *sub = cork_array_at(&group->subprocesses, i); + rii_check(cork_subprocess_abort(sub)); + } + return 0; +} + +int +cork_subprocess_group_start(struct cork_subprocess_group *group) +{ + size_t i; + DEBUG("Starting subprocess group\n"); + /* Start each subprocess. */ + for (i = 0; i < cork_array_size(&group->subprocesses); i++) { + struct cork_subprocess *sub = cork_array_at(&group->subprocesses, i); + ei_check(cork_subprocess_start(sub)); + } + return 0; + +error: + cork_subprocess_group_terminate(group); + return -1; +} + + +int +cork_subprocess_group_abort(struct cork_subprocess_group *group) +{ + DEBUG("Aborting subprocess group\n"); + return cork_subprocess_group_terminate(group); +} + + +bool +cork_subprocess_group_is_finished(struct cork_subprocess_group *group) +{ + size_t i; + for (i = 0; i < cork_array_size(&group->subprocesses); i++) { + struct cork_subprocess *sub = cork_array_at(&group->subprocesses, i); + bool sub_finished = cork_subprocess_is_finished(sub); + if (!sub_finished) { + return false; + } + } + return true; +} + +static int +cork_subprocess_group_drain_(struct cork_subprocess_group *group, + bool *progress) +{ + size_t i; + for (i = 0; i < cork_array_size(&group->subprocesses); i++) { + struct cork_subprocess *sub = cork_array_at(&group->subprocesses, i); + rii_check(cork_subprocess_drain_(sub, progress)); + } + return 0; +} + +bool +cork_subprocess_group_drain(struct cork_subprocess_group *group) +{ + bool progress = false; + cork_subprocess_group_drain_(group, &progress); + return progress; +} + +int +cork_subprocess_group_wait(struct cork_subprocess_group *group) +{ + unsigned int spin_count = 0; + bool progress; + DEBUG("Waiting for subprocess group to finish\n"); + while (!cork_subprocess_group_is_finished(group)) { + progress = false; + rii_check(cork_subprocess_group_drain_(group, &progress)); + if (!progress) { + cork_subprocess_yield(&spin_count); + } + } + return 0; +} diff --git a/libcork/pthreads/.dirstamp b/libcork/pthreads/.dirstamp new file mode 100644 index 00000000..e69de29b diff --git a/libcork/pthreads/thread.c b/libcork/pthreads/thread.c new file mode 100644 index 00000000..0dd55a30 --- /dev/null +++ b/libcork/pthreads/thread.c @@ -0,0 +1,183 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2013, RedJack, LLC. + * All rights reserved. + * + * Please see the COPYING file in this distribution for license details. + * ---------------------------------------------------------------------- + */ + +#include + +#include + +#include "libcork/core/allocator.h" +#include "libcork/core/error.h" +#include "libcork/core/types.h" +#include "libcork/ds/buffer.h" +#include "libcork/threads/basics.h" + + +/*----------------------------------------------------------------------- + * Current thread + */ + +static volatile cork_thread_id last_thread_descriptor = 0; + +struct cork_thread { + const char *name; + cork_thread_id id; + pthread_t thread_id; + struct cork_thread_body *body; + cork_error error_code; + struct cork_buffer error_message; + bool started; + bool joined; +}; + +struct cork_thread_descriptor { + struct cork_thread *current_thread; + cork_thread_id id; +}; + +cork_tls(struct cork_thread_descriptor, cork_thread_descriptor); + +struct cork_thread * +cork_current_thread_get(void) +{ + struct cork_thread_descriptor *desc = cork_thread_descriptor_get(); + return desc->current_thread; +} + +cork_thread_id +cork_current_thread_get_id(void) +{ + struct cork_thread_descriptor *desc = cork_thread_descriptor_get(); + if (CORK_UNLIKELY(desc->id == 0)) { + if (desc->current_thread == NULL) { + desc->id = cork_uint_atomic_add(&last_thread_descriptor, 1); + } else { + desc->id = desc->current_thread->id; + } + } + return desc->id; +} + + +/*----------------------------------------------------------------------- + * Threads + */ + +struct cork_thread * +cork_thread_new(const char *name, struct cork_thread_body *body) +{ + struct cork_thread *self = cork_new(struct cork_thread); + self->name = cork_strdup(name); + self->id = cork_uint_atomic_add(&last_thread_descriptor, 1); + self->body = body; + self->error_code = CORK_ERROR_NONE; + cork_buffer_init(&self->error_message); + self->started = false; + self->joined = false; + return self; +} + +static void +cork_thread_free_private(struct cork_thread *self) +{ + cork_strfree(self->name); + cork_thread_body_free(self->body); + cork_buffer_done(&self->error_message); + free(self); +} + +void +cork_thread_free(struct cork_thread *self) +{ + assert(!self->started); + cork_thread_free_private(self); +} + +const char * +cork_thread_get_name(struct cork_thread *self) +{ + return self->name; +} + +cork_thread_id +cork_thread_get_id(struct cork_thread *self) +{ + return self->id; +} + +static void * +cork_thread_pthread_run(void *vself) +{ + int rc; + struct cork_thread *self = vself; + struct cork_thread_descriptor *desc = cork_thread_descriptor_get(); + + desc->current_thread = self; + desc->id = self->id; + rc = cork_thread_body_run(self->body); + + /* If an error occurred in the body of the thread, save the error into the + * cork_thread object so that we can propagate that error when some calls + * cork_thread_join. */ + if (CORK_UNLIKELY(rc != 0)) { + if (CORK_LIKELY(cork_error_occurred())) { + self->error_code = cork_error_code(); + cork_buffer_set_string(&self->error_message, cork_error_message()); + } else { + self->error_code = CORK_UNKNOWN_ERROR; + cork_buffer_set_string(&self->error_message, "Unknown error"); + } + } + + return NULL; +} + +int +cork_thread_start(struct cork_thread *self) +{ + int rc; + pthread_t thread_id; + + assert(!self->started); + + rc = pthread_create(&thread_id, NULL, cork_thread_pthread_run, self); + if (CORK_UNLIKELY(rc != 0)) { + cork_system_error_set_explicit(rc); + return -1; + } + + self->thread_id = thread_id; + self->started = true; + return 0; +} + +int +cork_thread_join(struct cork_thread *self) +{ + int rc; + + assert(self->started && !self->joined); + + rc = pthread_join(self->thread_id, NULL); + if (CORK_UNLIKELY(rc != 0)) { + cork_system_error_set_explicit(rc); + cork_thread_free_private(self); + return -1; + } + + if (CORK_UNLIKELY(self->error_code != CORK_ERROR_NONE)) { + cork_error_set_printf + (self->error_code, "Error from thread %s: %s", + self->name, (char *) self->error_message.buf); + cork_thread_free_private(self); + return -1; + } + + cork_thread_free_private(self); + return 0; +} diff --git a/libev/Makefile.in b/libev/Makefile.in index 4bf48158..875b1016 100644 --- a/libev/Makefile.in +++ b/libev/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,23 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -52,9 +79,9 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libev -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - config.guess config.sub depcomp install-sh ltmain.sh missing \ - mkinstalldirs +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp README config.guess config.sub depcomp \ + install-sh missing mkinstalldirs ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -72,22 +99,47 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libev_la_LIBADD = am_libev_la_OBJECTS = ev.lo event.lo libev_la_OBJECTS = $(am_libev_la_OBJECTS) -libev_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(libev_la_LDFLAGS) \ - $(LDFLAGS) -o $@ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libev_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libev_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libev_la_SOURCES) DIST_SOURCES = $(libev_la_SOURCES) am__can_run_installinfo = \ @@ -95,11 +147,29 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -263,14 +333,17 @@ $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libev.la: $(libev_la_OBJECTS) $(libev_la_DEPENDENCIES) $(EXTRA_libev_la_DEPENDENCIES) - $(libev_la_LINK) $(libev_la_OBJECTS) $(libev_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(libev_la_LINK) $(libev_la_OBJECTS) $(libev_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -282,25 +355,28 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -308,26 +384,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -339,15 +404,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -356,6 +417,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -497,18 +573,19 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/libipset/Makefile b/libipset/Makefile new file mode 100644 index 00000000..982f34a8 --- /dev/null +++ b/libipset/Makefile @@ -0,0 +1,837 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# libipset/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + + +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/shadowsocks +pkgincludedir = $(includedir)/shadowsocks +pkglibdir = $(libdir)/shadowsocks +pkglibexecdir = $(libexecdir)/shadowsocks +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-apple-darwin13.1.0 +host_triplet = x86_64-apple-darwin13.1.0 +subdir = libipset +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ + $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libipset_la_LIBADD = +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_1 = bdd/libipset_la-assignments.lo \ + bdd/libipset_la-basics.lo bdd/libipset_la-bdd-iterator.lo \ + bdd/libipset_la-expanded.lo bdd/libipset_la-reachable.lo \ + bdd/libipset_la-read.lo bdd/libipset_la-write.lo +am__objects_2 = map/libipset_la-allocation.lo \ + map/libipset_la-inspection.lo map/libipset_la-ipv4_map.lo \ + map/libipset_la-ipv6_map.lo map/libipset_la-storage.lo +am__objects_3 = set/libipset_la-allocation.lo \ + set/libipset_la-inspection.lo set/libipset_la-ipv4_set.lo \ + set/libipset_la-ipv6_set.lo set/libipset_la-iterator.lo \ + set/libipset_la-storage.lo +am_libipset_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) +libipset_la_OBJECTS = $(am_libipset_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +libipset_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libipset_la_CFLAGS) \ + $(CFLAGS) $(libipset_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libipset_la_SOURCES) +DIST_SOURCES = $(libipset_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing aclocal-1.14 +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +AR = ar +AUTOCONF = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing autoconf +AUTOHEADER = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing autoheader +AUTOMAKE = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing automake-1.14 +AWK = gawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DLLTOOL = false +DSYMUTIL = dsymutil +DUMPBIN = +ECHO_C = \c +ECHO_N = +ECHO_T = +EGREP = /usr/bin/grep -E +EXEEXT = +FGREP = /usr/bin/grep -F +GREP = /usr/bin/grep +INET_NTOP_LIB = +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /Library/Developer/CommandLineTools/usr/bin/ld +LDFLAGS = +LIBOBJS = +LIBS = -lcrypto +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = lipo +LN_S = ln -s +LTLIBOBJS = +MAKEINFO = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/missing makeinfo +MANIFEST_TOOL = : +MKDIR_P = /usr/local/bin/gmkdir -p +NM = /usr/bin/nm +NMEDIT = nmedit +OBJDUMP = false +OBJEXT = o +OTOOL = otool +OTOOL64 = : +PACKAGE = shadowsocks +PACKAGE_BUGREPORT = max.c.lv@gmail.com +PACKAGE_NAME = shadowsocks +PACKAGE_STRING = shadowsocks 1.4.5 +PACKAGE_TARNAME = shadowsocks +PACKAGE_URL = +PACKAGE_VERSION = 1.4.5 +PATH_SEPARATOR = : +PTHREAD_CC = gcc +PTHREAD_CFLAGS = -D_THREAD_SAFE +PTHREAD_LIBS = +RANLIB = ranlib +SED = /usr/local/bin/gsed +SET_MAKE = +SHELL = /bin/sh +STRIP = strip +VERSION = 1.4.5 +abs_builddir = /Users/max/Develop/workspace/shadowsocks-libev/libipset +abs_srcdir = /Users/max/Develop/workspace/shadowsocks-libev/libipset +abs_top_builddir = /Users/max/Develop/workspace/shadowsocks-libev +abs_top_srcdir = /Users/max/Develop/workspace/shadowsocks-libev +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_DUMPBIN = +acx_pthread_config = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-apple-darwin13.1.0 +build_alias = +build_cpu = x86_64 +build_os = darwin13.1.0 +build_vendor = apple +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-apple-darwin13.1.0 +host_alias = +host_cpu = x86_64 +host_os = darwin13.1.0 +host_vendor = apple +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /Users/max/Develop/workspace/shadowsocks-libev/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +noinst_LTLIBRARIES = libipset.la +bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ + bdd/reachable.c bdd/read.c bdd/write.c + +map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ + map/storage.c + +set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ + set/iterator.c set/storage.c + +libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} +libipset_la_CFLAGS = -Iinclude +libipset_la_LDFLAGS = -static +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libipset/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libipset/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +bdd/$(am__dirstamp): + @$(MKDIR_P) bdd + @: > bdd/$(am__dirstamp) +bdd/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) bdd/$(DEPDIR) + @: > bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-assignments.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-basics.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-bdd-iterator.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-expanded.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-reachable.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-read.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-write.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +map/$(am__dirstamp): + @$(MKDIR_P) map + @: > map/$(am__dirstamp) +map/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) map/$(DEPDIR) + @: > map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-allocation.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-inspection.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-ipv4_map.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-ipv6_map.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-storage.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +set/$(am__dirstamp): + @$(MKDIR_P) set + @: > set/$(am__dirstamp) +set/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) set/$(DEPDIR) + @: > set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-allocation.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-inspection.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-ipv4_set.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-ipv6_set.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-iterator.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-storage.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) + +libipset.la: $(libipset_la_OBJECTS) $(libipset_la_DEPENDENCIES) $(EXTRA_libipset_la_DEPENDENCIES) + $(AM_V_CCLD)$(libipset_la_LINK) $(libipset_la_OBJECTS) $(libipset_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f bdd/*.$(OBJEXT) + -rm -f bdd/*.lo + -rm -f map/*.$(OBJEXT) + -rm -f map/*.lo + -rm -f set/*.$(OBJEXT) + -rm -f set/*.lo + +distclean-compile: + -rm -f *.tab.c + +include bdd/$(DEPDIR)/libipset_la-assignments.Plo +include bdd/$(DEPDIR)/libipset_la-basics.Plo +include bdd/$(DEPDIR)/libipset_la-bdd-iterator.Plo +include bdd/$(DEPDIR)/libipset_la-expanded.Plo +include bdd/$(DEPDIR)/libipset_la-reachable.Plo +include bdd/$(DEPDIR)/libipset_la-read.Plo +include bdd/$(DEPDIR)/libipset_la-write.Plo +include map/$(DEPDIR)/libipset_la-allocation.Plo +include map/$(DEPDIR)/libipset_la-inspection.Plo +include map/$(DEPDIR)/libipset_la-ipv4_map.Plo +include map/$(DEPDIR)/libipset_la-ipv6_map.Plo +include map/$(DEPDIR)/libipset_la-storage.Plo +include set/$(DEPDIR)/libipset_la-allocation.Plo +include set/$(DEPDIR)/libipset_la-inspection.Plo +include set/$(DEPDIR)/libipset_la-ipv4_set.Plo +include set/$(DEPDIR)/libipset_la-ipv6_set.Plo +include set/$(DEPDIR)/libipset_la-iterator.Plo +include set/$(DEPDIR)/libipset_la-storage.Plo + +.c.o: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ + $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ + $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ + $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Plo +# $(AM_V_CC)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< + +bdd/libipset_la-assignments.lo: bdd/assignments.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-assignments.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-assignments.Tpo -c -o bdd/libipset_la-assignments.lo `test -f 'bdd/assignments.c' || echo '$(srcdir)/'`bdd/assignments.c + $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-assignments.Tpo bdd/$(DEPDIR)/libipset_la-assignments.Plo +# $(AM_V_CC)source='bdd/assignments.c' object='bdd/libipset_la-assignments.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-assignments.lo `test -f 'bdd/assignments.c' || echo '$(srcdir)/'`bdd/assignments.c + +bdd/libipset_la-basics.lo: bdd/basics.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-basics.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-basics.Tpo -c -o bdd/libipset_la-basics.lo `test -f 'bdd/basics.c' || echo '$(srcdir)/'`bdd/basics.c + $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-basics.Tpo bdd/$(DEPDIR)/libipset_la-basics.Plo +# $(AM_V_CC)source='bdd/basics.c' object='bdd/libipset_la-basics.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-basics.lo `test -f 'bdd/basics.c' || echo '$(srcdir)/'`bdd/basics.c + +bdd/libipset_la-bdd-iterator.lo: bdd/bdd-iterator.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-bdd-iterator.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-bdd-iterator.Tpo -c -o bdd/libipset_la-bdd-iterator.lo `test -f 'bdd/bdd-iterator.c' || echo '$(srcdir)/'`bdd/bdd-iterator.c + $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-bdd-iterator.Tpo bdd/$(DEPDIR)/libipset_la-bdd-iterator.Plo +# $(AM_V_CC)source='bdd/bdd-iterator.c' object='bdd/libipset_la-bdd-iterator.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-bdd-iterator.lo `test -f 'bdd/bdd-iterator.c' || echo '$(srcdir)/'`bdd/bdd-iterator.c + +bdd/libipset_la-expanded.lo: bdd/expanded.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-expanded.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-expanded.Tpo -c -o bdd/libipset_la-expanded.lo `test -f 'bdd/expanded.c' || echo '$(srcdir)/'`bdd/expanded.c + $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-expanded.Tpo bdd/$(DEPDIR)/libipset_la-expanded.Plo +# $(AM_V_CC)source='bdd/expanded.c' object='bdd/libipset_la-expanded.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-expanded.lo `test -f 'bdd/expanded.c' || echo '$(srcdir)/'`bdd/expanded.c + +bdd/libipset_la-reachable.lo: bdd/reachable.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-reachable.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-reachable.Tpo -c -o bdd/libipset_la-reachable.lo `test -f 'bdd/reachable.c' || echo '$(srcdir)/'`bdd/reachable.c + $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-reachable.Tpo bdd/$(DEPDIR)/libipset_la-reachable.Plo +# $(AM_V_CC)source='bdd/reachable.c' object='bdd/libipset_la-reachable.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-reachable.lo `test -f 'bdd/reachable.c' || echo '$(srcdir)/'`bdd/reachable.c + +bdd/libipset_la-read.lo: bdd/read.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-read.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-read.Tpo -c -o bdd/libipset_la-read.lo `test -f 'bdd/read.c' || echo '$(srcdir)/'`bdd/read.c + $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-read.Tpo bdd/$(DEPDIR)/libipset_la-read.Plo +# $(AM_V_CC)source='bdd/read.c' object='bdd/libipset_la-read.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-read.lo `test -f 'bdd/read.c' || echo '$(srcdir)/'`bdd/read.c + +bdd/libipset_la-write.lo: bdd/write.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-write.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-write.Tpo -c -o bdd/libipset_la-write.lo `test -f 'bdd/write.c' || echo '$(srcdir)/'`bdd/write.c + $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-write.Tpo bdd/$(DEPDIR)/libipset_la-write.Plo +# $(AM_V_CC)source='bdd/write.c' object='bdd/libipset_la-write.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-write.lo `test -f 'bdd/write.c' || echo '$(srcdir)/'`bdd/write.c + +map/libipset_la-allocation.lo: map/allocation.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-allocation.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-allocation.Tpo -c -o map/libipset_la-allocation.lo `test -f 'map/allocation.c' || echo '$(srcdir)/'`map/allocation.c + $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-allocation.Tpo map/$(DEPDIR)/libipset_la-allocation.Plo +# $(AM_V_CC)source='map/allocation.c' object='map/libipset_la-allocation.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-allocation.lo `test -f 'map/allocation.c' || echo '$(srcdir)/'`map/allocation.c + +map/libipset_la-inspection.lo: map/inspection.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-inspection.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-inspection.Tpo -c -o map/libipset_la-inspection.lo `test -f 'map/inspection.c' || echo '$(srcdir)/'`map/inspection.c + $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-inspection.Tpo map/$(DEPDIR)/libipset_la-inspection.Plo +# $(AM_V_CC)source='map/inspection.c' object='map/libipset_la-inspection.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-inspection.lo `test -f 'map/inspection.c' || echo '$(srcdir)/'`map/inspection.c + +map/libipset_la-ipv4_map.lo: map/ipv4_map.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-ipv4_map.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-ipv4_map.Tpo -c -o map/libipset_la-ipv4_map.lo `test -f 'map/ipv4_map.c' || echo '$(srcdir)/'`map/ipv4_map.c + $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-ipv4_map.Tpo map/$(DEPDIR)/libipset_la-ipv4_map.Plo +# $(AM_V_CC)source='map/ipv4_map.c' object='map/libipset_la-ipv4_map.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-ipv4_map.lo `test -f 'map/ipv4_map.c' || echo '$(srcdir)/'`map/ipv4_map.c + +map/libipset_la-ipv6_map.lo: map/ipv6_map.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-ipv6_map.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-ipv6_map.Tpo -c -o map/libipset_la-ipv6_map.lo `test -f 'map/ipv6_map.c' || echo '$(srcdir)/'`map/ipv6_map.c + $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-ipv6_map.Tpo map/$(DEPDIR)/libipset_la-ipv6_map.Plo +# $(AM_V_CC)source='map/ipv6_map.c' object='map/libipset_la-ipv6_map.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-ipv6_map.lo `test -f 'map/ipv6_map.c' || echo '$(srcdir)/'`map/ipv6_map.c + +map/libipset_la-storage.lo: map/storage.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-storage.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-storage.Tpo -c -o map/libipset_la-storage.lo `test -f 'map/storage.c' || echo '$(srcdir)/'`map/storage.c + $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-storage.Tpo map/$(DEPDIR)/libipset_la-storage.Plo +# $(AM_V_CC)source='map/storage.c' object='map/libipset_la-storage.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-storage.lo `test -f 'map/storage.c' || echo '$(srcdir)/'`map/storage.c + +set/libipset_la-allocation.lo: set/allocation.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-allocation.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-allocation.Tpo -c -o set/libipset_la-allocation.lo `test -f 'set/allocation.c' || echo '$(srcdir)/'`set/allocation.c + $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-allocation.Tpo set/$(DEPDIR)/libipset_la-allocation.Plo +# $(AM_V_CC)source='set/allocation.c' object='set/libipset_la-allocation.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-allocation.lo `test -f 'set/allocation.c' || echo '$(srcdir)/'`set/allocation.c + +set/libipset_la-inspection.lo: set/inspection.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-inspection.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-inspection.Tpo -c -o set/libipset_la-inspection.lo `test -f 'set/inspection.c' || echo '$(srcdir)/'`set/inspection.c + $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-inspection.Tpo set/$(DEPDIR)/libipset_la-inspection.Plo +# $(AM_V_CC)source='set/inspection.c' object='set/libipset_la-inspection.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-inspection.lo `test -f 'set/inspection.c' || echo '$(srcdir)/'`set/inspection.c + +set/libipset_la-ipv4_set.lo: set/ipv4_set.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-ipv4_set.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-ipv4_set.Tpo -c -o set/libipset_la-ipv4_set.lo `test -f 'set/ipv4_set.c' || echo '$(srcdir)/'`set/ipv4_set.c + $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-ipv4_set.Tpo set/$(DEPDIR)/libipset_la-ipv4_set.Plo +# $(AM_V_CC)source='set/ipv4_set.c' object='set/libipset_la-ipv4_set.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-ipv4_set.lo `test -f 'set/ipv4_set.c' || echo '$(srcdir)/'`set/ipv4_set.c + +set/libipset_la-ipv6_set.lo: set/ipv6_set.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-ipv6_set.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-ipv6_set.Tpo -c -o set/libipset_la-ipv6_set.lo `test -f 'set/ipv6_set.c' || echo '$(srcdir)/'`set/ipv6_set.c + $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-ipv6_set.Tpo set/$(DEPDIR)/libipset_la-ipv6_set.Plo +# $(AM_V_CC)source='set/ipv6_set.c' object='set/libipset_la-ipv6_set.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-ipv6_set.lo `test -f 'set/ipv6_set.c' || echo '$(srcdir)/'`set/ipv6_set.c + +set/libipset_la-iterator.lo: set/iterator.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-iterator.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-iterator.Tpo -c -o set/libipset_la-iterator.lo `test -f 'set/iterator.c' || echo '$(srcdir)/'`set/iterator.c + $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-iterator.Tpo set/$(DEPDIR)/libipset_la-iterator.Plo +# $(AM_V_CC)source='set/iterator.c' object='set/libipset_la-iterator.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-iterator.lo `test -f 'set/iterator.c' || echo '$(srcdir)/'`set/iterator.c + +set/libipset_la-storage.lo: set/storage.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-storage.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-storage.Tpo -c -o set/libipset_la-storage.lo `test -f 'set/storage.c' || echo '$(srcdir)/'`set/storage.c + $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-storage.Tpo set/$(DEPDIR)/libipset_la-storage.Plo +# $(AM_V_CC)source='set/storage.c' object='set/libipset_la-storage.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-storage.lo `test -f 'set/storage.c' || echo '$(srcdir)/'`set/storage.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf bdd/.libs bdd/_libs + -rm -rf map/.libs map/_libs + -rm -rf set/.libs set/_libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f bdd/$(DEPDIR)/$(am__dirstamp) + -rm -f bdd/$(am__dirstamp) + -rm -f map/$(DEPDIR)/$(am__dirstamp) + -rm -f map/$(am__dirstamp) + -rm -f set/$(DEPDIR)/$(am__dirstamp) + -rm -f set/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf bdd/$(DEPDIR) map/$(DEPDIR) set/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf bdd/$(DEPDIR) map/$(DEPDIR) set/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libipset/Makefile.am b/libipset/Makefile.am new file mode 100644 index 00000000..9f7325e4 --- /dev/null +++ b/libipset/Makefile.am @@ -0,0 +1,31 @@ +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + +noinst_LTLIBRARIES = libipset.la + +bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ + bdd/reachable.c bdd/read.c bdd/write.c +map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ + map/storage.c +set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ + set/iterator.c set/storage.c + +libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} +libipset_la_CFLAGS = -Iinclude + +libipset_la_LDFLAGS = -static diff --git a/libipset/Makefile.in b/libipset/Makefile.in new file mode 100644 index 00000000..ba1fa744 --- /dev/null +++ b/libipset/Makefile.in @@ -0,0 +1,837 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = libipset +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/m4/openssl.m4 $(top_srcdir)/m4/polarssl.m4 \ + $(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libipset_la_LIBADD = +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_1 = bdd/libipset_la-assignments.lo \ + bdd/libipset_la-basics.lo bdd/libipset_la-bdd-iterator.lo \ + bdd/libipset_la-expanded.lo bdd/libipset_la-reachable.lo \ + bdd/libipset_la-read.lo bdd/libipset_la-write.lo +am__objects_2 = map/libipset_la-allocation.lo \ + map/libipset_la-inspection.lo map/libipset_la-ipv4_map.lo \ + map/libipset_la-ipv6_map.lo map/libipset_la-storage.lo +am__objects_3 = set/libipset_la-allocation.lo \ + set/libipset_la-inspection.lo set/libipset_la-ipv4_set.lo \ + set/libipset_la-ipv6_set.lo set/libipset_la-iterator.lo \ + set/libipset_la-storage.lo +am_libipset_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) +libipset_la_OBJECTS = $(am_libipset_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libipset_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libipset_la_CFLAGS) \ + $(CFLAGS) $(libipset_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libipset_la_SOURCES) +DIST_SOURCES = $(libipset_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +INET_NTOP_LIB = @INET_NTOP_LIB@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libipset.la +bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ + bdd/reachable.c bdd/read.c bdd/write.c + +map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ + map/storage.c + +set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ + set/iterator.c set/storage.c + +libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} +libipset_la_CFLAGS = -Iinclude +libipset_la_LDFLAGS = -static +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libipset/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libipset/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +bdd/$(am__dirstamp): + @$(MKDIR_P) bdd + @: > bdd/$(am__dirstamp) +bdd/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) bdd/$(DEPDIR) + @: > bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-assignments.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-basics.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-bdd-iterator.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-expanded.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-reachable.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-read.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +bdd/libipset_la-write.lo: bdd/$(am__dirstamp) \ + bdd/$(DEPDIR)/$(am__dirstamp) +map/$(am__dirstamp): + @$(MKDIR_P) map + @: > map/$(am__dirstamp) +map/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) map/$(DEPDIR) + @: > map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-allocation.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-inspection.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-ipv4_map.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-ipv6_map.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +map/libipset_la-storage.lo: map/$(am__dirstamp) \ + map/$(DEPDIR)/$(am__dirstamp) +set/$(am__dirstamp): + @$(MKDIR_P) set + @: > set/$(am__dirstamp) +set/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) set/$(DEPDIR) + @: > set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-allocation.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-inspection.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-ipv4_set.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-ipv6_set.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-iterator.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) +set/libipset_la-storage.lo: set/$(am__dirstamp) \ + set/$(DEPDIR)/$(am__dirstamp) + +libipset.la: $(libipset_la_OBJECTS) $(libipset_la_DEPENDENCIES) $(EXTRA_libipset_la_DEPENDENCIES) + $(AM_V_CCLD)$(libipset_la_LINK) $(libipset_la_OBJECTS) $(libipset_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f bdd/*.$(OBJEXT) + -rm -f bdd/*.lo + -rm -f map/*.$(OBJEXT) + -rm -f map/*.lo + -rm -f set/*.$(OBJEXT) + -rm -f set/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@bdd/$(DEPDIR)/libipset_la-assignments.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bdd/$(DEPDIR)/libipset_la-basics.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bdd/$(DEPDIR)/libipset_la-bdd-iterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bdd/$(DEPDIR)/libipset_la-expanded.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bdd/$(DEPDIR)/libipset_la-reachable.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bdd/$(DEPDIR)/libipset_la-read.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@bdd/$(DEPDIR)/libipset_la-write.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@map/$(DEPDIR)/libipset_la-allocation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@map/$(DEPDIR)/libipset_la-inspection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@map/$(DEPDIR)/libipset_la-ipv4_map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@map/$(DEPDIR)/libipset_la-ipv6_map.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@map/$(DEPDIR)/libipset_la-storage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@set/$(DEPDIR)/libipset_la-allocation.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@set/$(DEPDIR)/libipset_la-inspection.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@set/$(DEPDIR)/libipset_la-ipv4_set.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@set/$(DEPDIR)/libipset_la-ipv6_set.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@set/$(DEPDIR)/libipset_la-iterator.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@set/$(DEPDIR)/libipset_la-storage.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +bdd/libipset_la-assignments.lo: bdd/assignments.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-assignments.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-assignments.Tpo -c -o bdd/libipset_la-assignments.lo `test -f 'bdd/assignments.c' || echo '$(srcdir)/'`bdd/assignments.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-assignments.Tpo bdd/$(DEPDIR)/libipset_la-assignments.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdd/assignments.c' object='bdd/libipset_la-assignments.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-assignments.lo `test -f 'bdd/assignments.c' || echo '$(srcdir)/'`bdd/assignments.c + +bdd/libipset_la-basics.lo: bdd/basics.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-basics.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-basics.Tpo -c -o bdd/libipset_la-basics.lo `test -f 'bdd/basics.c' || echo '$(srcdir)/'`bdd/basics.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-basics.Tpo bdd/$(DEPDIR)/libipset_la-basics.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdd/basics.c' object='bdd/libipset_la-basics.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-basics.lo `test -f 'bdd/basics.c' || echo '$(srcdir)/'`bdd/basics.c + +bdd/libipset_la-bdd-iterator.lo: bdd/bdd-iterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-bdd-iterator.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-bdd-iterator.Tpo -c -o bdd/libipset_la-bdd-iterator.lo `test -f 'bdd/bdd-iterator.c' || echo '$(srcdir)/'`bdd/bdd-iterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-bdd-iterator.Tpo bdd/$(DEPDIR)/libipset_la-bdd-iterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdd/bdd-iterator.c' object='bdd/libipset_la-bdd-iterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-bdd-iterator.lo `test -f 'bdd/bdd-iterator.c' || echo '$(srcdir)/'`bdd/bdd-iterator.c + +bdd/libipset_la-expanded.lo: bdd/expanded.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-expanded.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-expanded.Tpo -c -o bdd/libipset_la-expanded.lo `test -f 'bdd/expanded.c' || echo '$(srcdir)/'`bdd/expanded.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-expanded.Tpo bdd/$(DEPDIR)/libipset_la-expanded.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdd/expanded.c' object='bdd/libipset_la-expanded.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-expanded.lo `test -f 'bdd/expanded.c' || echo '$(srcdir)/'`bdd/expanded.c + +bdd/libipset_la-reachable.lo: bdd/reachable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-reachable.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-reachable.Tpo -c -o bdd/libipset_la-reachable.lo `test -f 'bdd/reachable.c' || echo '$(srcdir)/'`bdd/reachable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-reachable.Tpo bdd/$(DEPDIR)/libipset_la-reachable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdd/reachable.c' object='bdd/libipset_la-reachable.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-reachable.lo `test -f 'bdd/reachable.c' || echo '$(srcdir)/'`bdd/reachable.c + +bdd/libipset_la-read.lo: bdd/read.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-read.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-read.Tpo -c -o bdd/libipset_la-read.lo `test -f 'bdd/read.c' || echo '$(srcdir)/'`bdd/read.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-read.Tpo bdd/$(DEPDIR)/libipset_la-read.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdd/read.c' object='bdd/libipset_la-read.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-read.lo `test -f 'bdd/read.c' || echo '$(srcdir)/'`bdd/read.c + +bdd/libipset_la-write.lo: bdd/write.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT bdd/libipset_la-write.lo -MD -MP -MF bdd/$(DEPDIR)/libipset_la-write.Tpo -c -o bdd/libipset_la-write.lo `test -f 'bdd/write.c' || echo '$(srcdir)/'`bdd/write.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) bdd/$(DEPDIR)/libipset_la-write.Tpo bdd/$(DEPDIR)/libipset_la-write.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bdd/write.c' object='bdd/libipset_la-write.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o bdd/libipset_la-write.lo `test -f 'bdd/write.c' || echo '$(srcdir)/'`bdd/write.c + +map/libipset_la-allocation.lo: map/allocation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-allocation.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-allocation.Tpo -c -o map/libipset_la-allocation.lo `test -f 'map/allocation.c' || echo '$(srcdir)/'`map/allocation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-allocation.Tpo map/$(DEPDIR)/libipset_la-allocation.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='map/allocation.c' object='map/libipset_la-allocation.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-allocation.lo `test -f 'map/allocation.c' || echo '$(srcdir)/'`map/allocation.c + +map/libipset_la-inspection.lo: map/inspection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-inspection.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-inspection.Tpo -c -o map/libipset_la-inspection.lo `test -f 'map/inspection.c' || echo '$(srcdir)/'`map/inspection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-inspection.Tpo map/$(DEPDIR)/libipset_la-inspection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='map/inspection.c' object='map/libipset_la-inspection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-inspection.lo `test -f 'map/inspection.c' || echo '$(srcdir)/'`map/inspection.c + +map/libipset_la-ipv4_map.lo: map/ipv4_map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-ipv4_map.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-ipv4_map.Tpo -c -o map/libipset_la-ipv4_map.lo `test -f 'map/ipv4_map.c' || echo '$(srcdir)/'`map/ipv4_map.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-ipv4_map.Tpo map/$(DEPDIR)/libipset_la-ipv4_map.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='map/ipv4_map.c' object='map/libipset_la-ipv4_map.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-ipv4_map.lo `test -f 'map/ipv4_map.c' || echo '$(srcdir)/'`map/ipv4_map.c + +map/libipset_la-ipv6_map.lo: map/ipv6_map.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-ipv6_map.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-ipv6_map.Tpo -c -o map/libipset_la-ipv6_map.lo `test -f 'map/ipv6_map.c' || echo '$(srcdir)/'`map/ipv6_map.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-ipv6_map.Tpo map/$(DEPDIR)/libipset_la-ipv6_map.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='map/ipv6_map.c' object='map/libipset_la-ipv6_map.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-ipv6_map.lo `test -f 'map/ipv6_map.c' || echo '$(srcdir)/'`map/ipv6_map.c + +map/libipset_la-storage.lo: map/storage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT map/libipset_la-storage.lo -MD -MP -MF map/$(DEPDIR)/libipset_la-storage.Tpo -c -o map/libipset_la-storage.lo `test -f 'map/storage.c' || echo '$(srcdir)/'`map/storage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) map/$(DEPDIR)/libipset_la-storage.Tpo map/$(DEPDIR)/libipset_la-storage.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='map/storage.c' object='map/libipset_la-storage.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o map/libipset_la-storage.lo `test -f 'map/storage.c' || echo '$(srcdir)/'`map/storage.c + +set/libipset_la-allocation.lo: set/allocation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-allocation.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-allocation.Tpo -c -o set/libipset_la-allocation.lo `test -f 'set/allocation.c' || echo '$(srcdir)/'`set/allocation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-allocation.Tpo set/$(DEPDIR)/libipset_la-allocation.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='set/allocation.c' object='set/libipset_la-allocation.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-allocation.lo `test -f 'set/allocation.c' || echo '$(srcdir)/'`set/allocation.c + +set/libipset_la-inspection.lo: set/inspection.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-inspection.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-inspection.Tpo -c -o set/libipset_la-inspection.lo `test -f 'set/inspection.c' || echo '$(srcdir)/'`set/inspection.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-inspection.Tpo set/$(DEPDIR)/libipset_la-inspection.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='set/inspection.c' object='set/libipset_la-inspection.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-inspection.lo `test -f 'set/inspection.c' || echo '$(srcdir)/'`set/inspection.c + +set/libipset_la-ipv4_set.lo: set/ipv4_set.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-ipv4_set.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-ipv4_set.Tpo -c -o set/libipset_la-ipv4_set.lo `test -f 'set/ipv4_set.c' || echo '$(srcdir)/'`set/ipv4_set.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-ipv4_set.Tpo set/$(DEPDIR)/libipset_la-ipv4_set.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='set/ipv4_set.c' object='set/libipset_la-ipv4_set.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-ipv4_set.lo `test -f 'set/ipv4_set.c' || echo '$(srcdir)/'`set/ipv4_set.c + +set/libipset_la-ipv6_set.lo: set/ipv6_set.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-ipv6_set.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-ipv6_set.Tpo -c -o set/libipset_la-ipv6_set.lo `test -f 'set/ipv6_set.c' || echo '$(srcdir)/'`set/ipv6_set.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-ipv6_set.Tpo set/$(DEPDIR)/libipset_la-ipv6_set.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='set/ipv6_set.c' object='set/libipset_la-ipv6_set.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-ipv6_set.lo `test -f 'set/ipv6_set.c' || echo '$(srcdir)/'`set/ipv6_set.c + +set/libipset_la-iterator.lo: set/iterator.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-iterator.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-iterator.Tpo -c -o set/libipset_la-iterator.lo `test -f 'set/iterator.c' || echo '$(srcdir)/'`set/iterator.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-iterator.Tpo set/$(DEPDIR)/libipset_la-iterator.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='set/iterator.c' object='set/libipset_la-iterator.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-iterator.lo `test -f 'set/iterator.c' || echo '$(srcdir)/'`set/iterator.c + +set/libipset_la-storage.lo: set/storage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -MT set/libipset_la-storage.lo -MD -MP -MF set/$(DEPDIR)/libipset_la-storage.Tpo -c -o set/libipset_la-storage.lo `test -f 'set/storage.c' || echo '$(srcdir)/'`set/storage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) set/$(DEPDIR)/libipset_la-storage.Tpo set/$(DEPDIR)/libipset_la-storage.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='set/storage.c' object='set/libipset_la-storage.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libipset_la_CFLAGS) $(CFLAGS) -c -o set/libipset_la-storage.lo `test -f 'set/storage.c' || echo '$(srcdir)/'`set/storage.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf bdd/.libs bdd/_libs + -rm -rf map/.libs map/_libs + -rm -rf set/.libs set/_libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f bdd/$(DEPDIR)/$(am__dirstamp) + -rm -f bdd/$(am__dirstamp) + -rm -f map/$(DEPDIR)/$(am__dirstamp) + -rm -f map/$(am__dirstamp) + -rm -f set/$(DEPDIR)/$(am__dirstamp) + -rm -f set/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf bdd/$(DEPDIR) map/$(DEPDIR) set/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf bdd/$(DEPDIR) map/$(DEPDIR) set/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libipset/bdd/.dirstamp b/libipset/bdd/.dirstamp new file mode 100644 index 00000000..e69de29b diff --git a/libipset/bdd/Makefile.am b/libipset/bdd/Makefile.am new file mode 100644 index 00000000..b037b316 --- /dev/null +++ b/libipset/bdd/Makefile.am @@ -0,0 +1,30 @@ +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + +noinst_LTLIBRARIES = libipset.la + +bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ + bdd/reachable.c bdd/read.c bdd/write.c +map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ + map/storage.c +set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ + set/iterator.c set/storage.c + +libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} + +libipset_la_LDFLAGS = -static diff --git a/libipset/bdd/assignments.c b/libipset/bdd/assignments.c new file mode 100644 index 00000000..41d57021 --- /dev/null +++ b/libipset/bdd/assignments.c @@ -0,0 +1,134 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" + + +struct ipset_assignment * +ipset_assignment_new() +{ + struct ipset_assignment *assignment = cork_new(struct ipset_assignment); + cork_array_init(&assignment->values); + return assignment; +} + + +void +ipset_assignment_free(struct ipset_assignment *assignment) +{ + cork_array_done(&assignment->values); + free(assignment); +} + + +bool +ipset_assignment_equal(const struct ipset_assignment *assignment1, + const struct ipset_assignment *assignment2) +{ + /* Identical pointers are trivially equal. */ + if (assignment1 == assignment2) { + return true; + } + + /* Otherwise we compare the assignments piecewise up through the end + * of the smaller vector. */ + unsigned int size1 = cork_array_size(&assignment1->values); + unsigned int size2 = cork_array_size(&assignment2->values); + unsigned int smaller_size = (size1 < size2)? size1: size2; + + unsigned int i; + for (i = 0; i < smaller_size; i++) { + if (cork_array_at(&assignment1->values, i) != + cork_array_at(&assignment2->values, i)) { + return false; + } + } + + /* If one of the assignment vectors is longer, any remaining + * elements must be indeterminate. */ + if (size1 > smaller_size) { + for (i = smaller_size; i < size1; i++) { + if (cork_array_at(&assignment1->values, i) != IPSET_EITHER) { + return false; + } + } + } + + if (size2 > smaller_size) { + for (i = smaller_size; i < size2; i++) { + if (cork_array_at(&assignment2->values, i) != IPSET_EITHER) { + return false; + } + } + } + + /* If we make it through all of that, the two assignments are equal. */ + return true; +} + + +void +ipset_assignment_cut(struct ipset_assignment *assignment, + ipset_variable var) +{ + if (var < cork_array_size(&assignment->values)) { + assignment->values.size = var; + } +} + + +void +ipset_assignment_clear(struct ipset_assignment *assignment) +{ + ipset_assignment_cut(assignment, 0); +} + + +enum ipset_tribool +ipset_assignment_get(struct ipset_assignment *assignment, ipset_variable var) +{ + if (var < cork_array_size(&assignment->values)) { + /* If the requested variable is in the range of the values + * array, return whatever is stored there. */ + return cork_array_at(&assignment->values, var); + } else { + /* Variables htat aren't in the values array are always EITHER. */ + return IPSET_EITHER; + } +} + + +void +ipset_assignment_set(struct ipset_assignment *assignment, + ipset_variable var, enum ipset_tribool value) +{ + /* Ensure that the vector is big enough to hold this variable + * assignment, inserting new EITHERs if needed. */ + if (var >= cork_array_size(&assignment->values)) { + unsigned int old_len = cork_array_size(&assignment->values); + + /* Expand the array. */ + cork_array_ensure_size(&assignment->values, var+1); + assignment->values.size = var+1; + + /* Fill in EITHERs in the newly allocated elements. */ + if (var != old_len) { + unsigned int i; + for (i = old_len; i < var; i++) { + cork_array_at(&assignment->values, i) = IPSET_EITHER; + } + } + } + + /* Assign the desired value. */ + cork_array_at(&assignment->values, var) = value; +} diff --git a/libipset/bdd/basics.c b/libipset/bdd/basics.c new file mode 100644 index 00000000..3db6f17e --- /dev/null +++ b/libipset/bdd/basics.c @@ -0,0 +1,467 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/bits.h" +#include "ipset/logging.h" + + +void +ipset_node_fprint(FILE *stream, struct ipset_node *node) +{ + fprintf(stream, + "nonterminal(x%u? " IPSET_NODE_ID_FORMAT + ": " IPSET_NODE_ID_FORMAT ")", + node->variable, + IPSET_NODE_ID_VALUES(node->high), + IPSET_NODE_ID_VALUES(node->low)); +} + + +static cork_hash +ipset_node_hash(void *user_data, const void *key) +{ + const struct ipset_node *node = key; + /* Hash of "ipset_node" */ + cork_hash hash = 0xf3b7dc44; + hash = cork_hash_variable(hash, node->variable); + hash = cork_hash_variable(hash, node->low); + hash = cork_hash_variable(hash, node->high); + return hash; +} + +static bool +ipset_node_equals(void *user_data, const void *key1, const void *key2) +{ + const struct ipset_node *node1 = key1; + const struct ipset_node *node2 = key2; + + if (node1 == node2) { + return true; + } + + return + (node1->variable == node2->variable) && + (node1->low == node2->low) && + (node1->high == node2->high); +} + + +/* The free list in an ipset_node_cache is represented by a + * singly-linked list of indices into the chunk array. Since the + * ipset_node instance is unused for nodes in the free list, we reuse + * the refcount field to store the "next" index. */ + +#define IPSET_NULL_INDEX ((ipset_variable) -1) + +struct ipset_node_cache * +ipset_node_cache_new() +{ + struct ipset_node_cache *cache = cork_new(struct ipset_node_cache); + cork_array_init(&cache->chunks); + cache->largest_index = 0; + cache->free_list = IPSET_NULL_INDEX; + cache->node_cache = cork_hash_table_new(0, 0); + cork_hash_table_set_hash + (cache->node_cache, (cork_hash_f) ipset_node_hash); + cork_hash_table_set_equals + (cache->node_cache, (cork_equals_f) ipset_node_equals); + return cache; +} + +void +ipset_node_cache_free(struct ipset_node_cache *cache) +{ + size_t i; + for (i = 0; i < cork_array_size(&cache->chunks); i++) { + free(cork_array_at(&cache->chunks, i)); + } + cork_array_done(&cache->chunks); + cork_hash_table_free(cache->node_cache); + free(cache); +} + + +/** + * Returns the index of a new ipset_node instance. + */ +static ipset_value +ipset_node_cache_alloc_node(struct ipset_node_cache *cache) +{ + if (cache->free_list == IPSET_NULL_INDEX) { + /* Nothing in the free list; need to allocate a new node. */ + ipset_value next_index = cache->largest_index++; + ipset_value chunk_index = next_index >> IPSET_BDD_NODE_CACHE_BIT_SIZE; + if (chunk_index >= cork_array_size(&cache->chunks)) { + /* We've filled up all of the existing chunks, and need to + * create a new one. */ + DEBUG(" (allocating chunk %zu)", + cork_array_size(&cache->chunks)); + struct ipset_node *new_chunk = cork_calloc + (IPSET_BDD_NODE_CACHE_SIZE, sizeof(struct ipset_node)); + cork_array_append(&cache->chunks, new_chunk); + } + return next_index; + } else { + /* Reuse a recently freed node. */ + ipset_value next_index = cache->free_list; + struct ipset_node *node = + ipset_node_cache_get_nonterminal_by_index(cache, next_index); + cache->free_list = node->refcount; + return next_index; + } +} + +ipset_node_id +ipset_node_incref(struct ipset_node_cache *cache, ipset_node_id node_id) +{ + if (ipset_node_get_type(node_id) == IPSET_NONTERMINAL_NODE) { + struct ipset_node *node = + ipset_node_cache_get_nonterminal(cache, node_id); + DEBUG(" [incref " IPSET_NODE_ID_FORMAT "]", + IPSET_NODE_ID_VALUES(node_id)); + node->refcount++; + } + return node_id; +} + +void +ipset_node_decref(struct ipset_node_cache *cache, ipset_node_id node_id) +{ + if (ipset_node_get_type(node_id) == IPSET_NONTERMINAL_NODE) { + struct ipset_node *node = + ipset_node_cache_get_nonterminal(cache, node_id); + DEBUG(" [decref " IPSET_NODE_ID_FORMAT "]", + IPSET_NODE_ID_VALUES(node_id)); + if (--node->refcount == 0) { + DEBUG(" [free " IPSET_NODE_ID_FORMAT "]", + IPSET_NODE_ID_VALUES(node_id)); + ipset_node_decref(cache, node->low); + ipset_node_decref(cache, node->high); + cork_hash_table_delete(cache->node_cache, node, NULL, NULL); + + /* Add the node to the free list */ + node->refcount = cache->free_list; + cache->free_list = ipset_nonterminal_value(node_id); + } + } +} + +bool +ipset_node_cache_nodes_equal(const struct ipset_node_cache *cache1, + ipset_node_id node_id1, + const struct ipset_node_cache *cache2, + ipset_node_id node_id2) +{ + struct ipset_node *node1; + struct ipset_node *node2; + + if (ipset_node_get_type(node_id1) != ipset_node_get_type(node_id2)) { + return false; + } + + if (ipset_node_get_type(node_id1) == IPSET_TERMINAL_NODE) { + return node_id1 == node_id2; + } + + node1 = ipset_node_cache_get_nonterminal(cache1, node_id1); + node2 = ipset_node_cache_get_nonterminal(cache2, node_id2); + return + (node1->variable == node2->variable) && + ipset_node_cache_nodes_equal(cache1, node1->low, cache2, node2->low) && + ipset_node_cache_nodes_equal(cache1, node1->high, cache2, node2->high); +} + +ipset_node_id +ipset_node_cache_nonterminal(struct ipset_node_cache *cache, + ipset_variable variable, + ipset_node_id low, ipset_node_id high) +{ + /* Don't allow any nonterminals whose low and high subtrees are the + * same, since the nonterminal would be redundant. */ + if (CORK_UNLIKELY(low == high)) { + DEBUG(" [ SKIP nonterminal(x%u? " + IPSET_NODE_ID_FORMAT ": " IPSET_NODE_ID_FORMAT ")]", + variable, IPSET_NODE_ID_VALUES(high), IPSET_NODE_ID_VALUES(low)); + ipset_node_decref(cache, high); + return low; + } + + /* Check to see if there's already a nonterminal with these contents + * in the cache. */ + DEBUG(" [search nonterminal(x%u? " + IPSET_NODE_ID_FORMAT ": " IPSET_NODE_ID_FORMAT ")]", + variable, IPSET_NODE_ID_VALUES(high), IPSET_NODE_ID_VALUES(low)); + + struct ipset_node search_node; + search_node.variable = variable; + search_node.low = low; + search_node.high = high; + + bool is_new; + struct cork_hash_table_entry *entry = + cork_hash_table_get_or_create + (cache->node_cache, &search_node, &is_new); + + if (!is_new) { + /* There's already a node with these contents, so return its ID. */ + ipset_node_id node_id = (uintptr_t) entry->value; + DEBUG(" [reuse " IPSET_NODE_ID_FORMAT "]", + IPSET_NODE_ID_VALUES(node_id)); + ipset_node_incref(cache, node_id); + ipset_node_decref(cache, low); + ipset_node_decref(cache, high); + return node_id; + } else { + /* This node doesn't exist yet. Allocate a permanent copy of + * the node, add it to the cache, and then return its ID. */ + ipset_value new_index = ipset_node_cache_alloc_node(cache); + ipset_node_id new_node_id = ipset_nonterminal_node_id(new_index); + struct ipset_node *real_node = + ipset_node_cache_get_nonterminal_by_index(cache, new_index); + real_node->refcount = 1; + real_node->variable = variable; + real_node->low = low; + real_node->high = high; + entry->key = real_node; + entry->value = (void *) (uintptr_t) new_node_id; + DEBUG(" [new " IPSET_NODE_ID_FORMAT "]", + IPSET_NODE_ID_VALUES(new_node_id)); + return new_node_id; + } +} + + +bool +ipset_bool_array_assignment(const void *user_data, ipset_variable variable) +{ + const bool *bool_array = (const bool *) user_data; + return bool_array[variable]; +} + + +bool +ipset_bit_array_assignment(const void *user_data, ipset_variable variable) +{ + return IPSET_BIT_GET(user_data, variable); +} + + +ipset_value +ipset_node_evaluate(const struct ipset_node_cache *cache, ipset_node_id node_id, + ipset_assignment_func assignment, const void *user_data) +{ + ipset_node_id curr_node_id = node_id; + DEBUG("Evaluating BDD node " IPSET_NODE_ID_FORMAT, + IPSET_NODE_ID_VALUES(node_id)); + + /* As long as the current node is a nonterminal, we have to check + * the value of the current variable. */ + while (ipset_node_get_type(curr_node_id) == IPSET_NONTERMINAL_NODE) { + /* We have to look up this variable in the assignment. */ + struct ipset_node *node = + ipset_node_cache_get_nonterminal(cache, curr_node_id); + bool this_value = assignment(user_data, node->variable); + DEBUG("[%3u] Nonterminal " IPSET_NODE_ID_FORMAT, + node->variable, IPSET_NODE_ID_VALUES(curr_node_id)); + DEBUG("[%3u] x%u = %s", + node->variable, node->variable, this_value? "TRUE": "FALSE"); + + if (this_value) { + /* This node's variable is true in the assignment vector, so + * trace down the high subtree. */ + curr_node_id = node->high; + } else { + /* This node's variable is false in the assignment vector, + * so trace down the low subtree. */ + curr_node_id = node->low; + } + } + + /* Once we find a terminal node, we've got the final result. */ + DEBUG("Evaluated result is %u", ipset_terminal_value(curr_node_id)); + return ipset_terminal_value(curr_node_id); +} + + +/* A “fake” BDD node given by an assignment. */ +struct ipset_fake_node { + ipset_variable current_var; + ipset_variable var_count; + ipset_assignment_func assignment; + const void *user_data; + ipset_value value; +}; + +/* A fake BDD node representing the terminal 0 value. */ +static struct ipset_fake_node fake_terminal_0 = { 0, 0, NULL, 0, 0 }; + +/* We set elements in a map using the if-then-else (ITE) operator: + * + * new_set = new_element? new_value: old_set + * + * The below is a straight copy of the standard trinary APPLY from the BDD + * literature, but without the caching of the results. And also with the + * wrinkle that the F argument to ITE (i.e., new_element) is given by an + * assignment, and not by a BDD node. (This lets us skip constructing the BDD + * for the assignment, saving us a few cycles.) + */ + +static ipset_node_id +ipset_apply_ite(struct ipset_node_cache *cache, struct ipset_fake_node *f, + ipset_value g, ipset_node_id h) +{ + ipset_node_id h_low; + ipset_node_id h_high; + ipset_node_id result_low; + ipset_node_id result_high; + + /* If F is a terminal, then we're in one of the following two + * cases: + * + * 1? G: H == G + * 0? G: H == H + */ + if (f->current_var == f->var_count) { + ipset_node_id result; + DEBUG("[%3u] F is terminal (value %u)", f->current_var, f->value); + + if (f->value == 0) { + DEBUG("[%3u] 0? " IPSET_NODE_ID_FORMAT ": " IPSET_NODE_ID_FORMAT + " = " IPSET_NODE_ID_FORMAT, + f->current_var, + IPSET_NODE_ID_VALUES(ipset_terminal_node_id(g)), + IPSET_NODE_ID_VALUES(h), IPSET_NODE_ID_VALUES(h)); + result = ipset_node_incref(cache, h); + } else { + result = ipset_terminal_node_id(g); + DEBUG("[%3u] 1? " IPSET_NODE_ID_FORMAT ": " IPSET_NODE_ID_FORMAT + " = " IPSET_NODE_ID_FORMAT, + f->current_var, IPSET_NODE_ID_VALUES(result), + IPSET_NODE_ID_VALUES(h), IPSET_NODE_ID_VALUES(result)); + } + + return result; + } + + /* F? G: G == G */ + if (h == ipset_terminal_node_id(g)) { + DEBUG("[%3u] F? " IPSET_NODE_ID_FORMAT ": " IPSET_NODE_ID_FORMAT + " = " IPSET_NODE_ID_FORMAT, + f->current_var, IPSET_NODE_ID_VALUES(h), + IPSET_NODE_ID_VALUES(h), IPSET_NODE_ID_VALUES(h)); + return h; + } + + /* From here to the end of the function, we know that F is a + * nonterminal. */ + DEBUG("[%3u] F is nonterminal", f->current_var); + + /* We're going to do two recursive calls, a “low” one and a “high” one. For + * each nonterminal that has the minimum variable number, we use its low and + * high pointers in the respective recursive call. For all other + * nonterminals, and for all terminals, we use the operand itself. */ + + if (ipset_node_get_type(h) == IPSET_NONTERMINAL_NODE) { + struct ipset_node *h_node = + ipset_node_cache_get_nonterminal(cache, h); + + DEBUG("[%3u] H is nonterminal (variable %u)", + f->current_var, h_node->variable); + + if (h_node->variable < f->current_var) { + /* var(F) > var(H), so we only recurse down the H branches. */ + DEBUG("[%3u] Recursing only down H", f->current_var); + DEBUG("[%3u] Recursing high", f->current_var); + result_high = ipset_apply_ite(cache, f, g, h_node->high); + DEBUG("[%3u] Back from high recursion", f->current_var); + DEBUG("[%3u] Recursing low", f->current_var); + result_low = ipset_apply_ite(cache, f, g, h_node->low); + DEBUG("[%3u] Back from low recursion", f->current_var); + return ipset_node_cache_nonterminal + (cache, h_node->variable, result_low, result_high); + } else if (h_node->variable == f->current_var) { + /* var(F) == var(H), so we recurse down both branches. */ + DEBUG("[%3u] Recursing down both F and H", f->current_var); + h_low = h_node->low; + h_high = h_node->high; + } else { + /* var(F) < var(H), so we only recurse down the F branches. */ + DEBUG("[%3u] Recursing only down F", f->current_var); + h_low = h; + h_high = h; + } + } else { + /* H in nonterminal, so we only recurse down the F branches. */ + DEBUG("[%3u] H is terminal (value %u)", + f->current_var, ipset_terminal_value(h)); + DEBUG("[%3u] Recursing only down F", f->current_var); + h_low = h; + h_high = h; + } + + /* F is a “fake” nonterminal node, since it comes from our assignment. One + * of its branches will be the 0 terminal, and the other will be the fake + * nonterminal for the next variable in the assignment. (Which one is low + * and which one is high depends on the value of the current variable in the + * assignment.) */ + + if (f->assignment(f->user_data, f->current_var)) { + /* The current variable is set in F. The low branch is terminal 0; the + * high branch is the next variable in F. */ + DEBUG("[%3u] x[%u] is set", f->current_var, f->current_var); + DEBUG("[%3u] Recursing high", f->current_var); + f->current_var++; + result_high = ipset_apply_ite(cache, f, g, h_high); + f->current_var--; + DEBUG("[%3u] Back from high recursion: " IPSET_NODE_ID_FORMAT, + f->current_var, IPSET_NODE_ID_VALUES(result_high)); + DEBUG("[%3u] Recursing low", f->current_var); + fake_terminal_0.current_var = f->var_count; + fake_terminal_0.var_count = f->var_count; + result_low = ipset_apply_ite(cache, &fake_terminal_0, g, h_low); + DEBUG("[%3u] Back from low recursion: " IPSET_NODE_ID_FORMAT, + f->current_var, IPSET_NODE_ID_VALUES(result_low)); + } else { + /* The current variable is NOT set in F. The high branch is terminal 0; + * the low branch is the next variable in F. */ + DEBUG("[%3u] x[%u] is NOT set", f->current_var, f->current_var); + DEBUG("[%3u] Recursing high", f->current_var); + fake_terminal_0.current_var = f->var_count; + fake_terminal_0.var_count = f->var_count; + result_high = ipset_apply_ite(cache, &fake_terminal_0, g, h_high); + DEBUG("[%3u] Back from high recursion: " IPSET_NODE_ID_FORMAT, + f->current_var, IPSET_NODE_ID_VALUES(result_high)); + DEBUG("[%3u] Recursing low", f->current_var); + f->current_var++; + result_low = ipset_apply_ite(cache, f, g, h_low); + f->current_var--; + DEBUG("[%3u] Back from low recursion: " IPSET_NODE_ID_FORMAT, + f->current_var, IPSET_NODE_ID_VALUES(result_low)); + } + + return ipset_node_cache_nonterminal + (cache, f->current_var, result_low, result_high); +} + +ipset_node_id +ipset_node_insert(struct ipset_node_cache *cache, ipset_node_id node, + ipset_assignment_func assignment, const void *user_data, + ipset_variable var_count, ipset_value value) +{ + struct ipset_fake_node f = { 0, var_count, assignment, user_data, 1 }; + DEBUG("Inserting new element"); + return ipset_apply_ite(cache, &f, value, node); +} diff --git a/libipset/bdd/bdd-iterator.c b/libipset/bdd/bdd-iterator.c new file mode 100644 index 00000000..c2462452 --- /dev/null +++ b/libipset/bdd/bdd-iterator.c @@ -0,0 +1,129 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/logging.h" + + +/** + * Add the given node ID to the node stack, and trace down from it + * until we find a terminal node. Assign values to the variables for + * each nonterminal that encounter along the way. We check low edges + * first, so each new variable we encounter will be assigned FALSE. + * (The high edges will be checked eventually by a call to the + * ipset_bdd_iterator_advance() function.) + */ +static void +add_node(struct ipset_bdd_iterator *iterator, ipset_node_id node_id) +{ + /* Keep tracing down low edges until we reach a terminal. */ + while (ipset_node_get_type(node_id) == IPSET_NONTERMINAL_NODE) { + /* Add this nonterminal node to the stack, and trace down + * further into the tree. We check low edges first, so set the + * node's variable to FALSE in the assignment. */ + struct ipset_node *node = + ipset_node_cache_get_nonterminal(iterator->cache, node_id); + + cork_array_append(&iterator->stack, node_id); + ipset_assignment_set(iterator->assignment, node->variable, false); + + node_id = node->low; + } + + /* Once we find a terminal node, save it away in the iterator result + * and return. */ + iterator->value = ipset_terminal_value(node_id); +} + + +struct ipset_bdd_iterator * +ipset_node_iterate(struct ipset_node_cache *cache, ipset_node_id root) +{ + /* First allocate the iterator itself, and all of its contained + * fields. */ + + struct ipset_bdd_iterator *iterator = + cork_new(struct ipset_bdd_iterator); + iterator->finished = false; + iterator->cache = cache; + cork_array_init(&iterator->stack); + iterator->assignment = ipset_assignment_new(); + + /* Then add the root node to the iterator, tracing down until we + * find the first terminal node. */ + add_node(iterator, root); + return iterator; +} + + +void +ipset_bdd_iterator_free(struct ipset_bdd_iterator *iterator) +{ + cork_array_done(&iterator->stack); + ipset_assignment_free(iterator->assignment); + free(iterator); +} + + +void +ipset_bdd_iterator_advance(struct ipset_bdd_iterator *iterator) +{ + /* If we're already at the end of the iterator, don't do anything. */ + if (CORK_UNLIKELY(iterator->finished)) { + return; + } + + /* We look at the last node in the stack. If it's currently + * assigned a false value, then we track down its true branch. If + * it's got a true branch, then we pop it off and check the next to + * last node. */ + + DEBUG("Advancing BDD iterator"); + + while (cork_array_size(&iterator->stack) > 0) { + ipset_node_id last_node_id = + cork_array_at + (&iterator->stack, cork_array_size(&iterator->stack) - 1); + + struct ipset_node *last_node = + ipset_node_cache_get_nonterminal(iterator->cache, last_node_id); + + enum ipset_tribool current_value = + ipset_assignment_get(iterator->assignment, last_node->variable); + + /* The current value can't be EITHER, because we definitely + * assign a TRUE or FALSE to the variables of the nodes that we + * encounter. */ + if (current_value == IPSET_TRUE) { + /* We've checked both outgoing edges for this node, so pop + * it off and look at its parent. */ + iterator->stack.size--; + + /* Before continuing, reset this node's variable to + * indeterminate in the assignment. */ + ipset_assignment_set + (iterator->assignment, last_node->variable, IPSET_EITHER); + } else { + /* We've checked this node's low edge, but not its high + * edge. Set the variable to TRUE in the assignment, and + * add the high edge's node to the node stack. */ + ipset_assignment_set + (iterator->assignment, last_node->variable, IPSET_TRUE); + add_node(iterator, last_node->high); + return; + } + } + + /* If we fall through then we ran out of nodes to check. That means + * the iterator is done! */ + iterator->finished = true; +} diff --git a/libipset/bdd/expanded.c b/libipset/bdd/expanded.c new file mode 100644 index 00000000..6a97fd7c --- /dev/null +++ b/libipset/bdd/expanded.c @@ -0,0 +1,138 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/bits.h" +#include "ipset/logging.h" + + +static void +initialize(struct ipset_expanded_assignment *exp, + const struct ipset_assignment *assignment, + ipset_variable var_count) +{ + /* First loop through all of the variables in the assignment vector, + * making sure not to go further than the caller requested. */ + + ipset_variable last_assignment = cork_array_size(&assignment->values); + if (var_count < last_assignment) { + last_assignment = var_count; + } + + ipset_variable var; + for (var = 0; var < last_assignment; var++) { + enum ipset_tribool curr_value = + cork_array_at(&assignment->values, var); + + if (curr_value == IPSET_EITHER) { + /* If this variable is EITHER, start it off as FALSE, and + * add it to the eithers list. */ + DEBUG("Variable %u is EITHER", var); + + IPSET_BIT_SET(exp->values.buf, var, false); + cork_array_append(&exp->eithers, var); + } else { + /* Otherwise set the variable to the same value in the + * expanded assignment as it is in the non-expanded one. */ + + DEBUG("Variable %u is %s", var, curr_value? "true": "false"); + IPSET_BIT_SET(exp->values.buf, var, curr_value); + } + } + + /* If the caller requested more variables than there are in the + * assignment vector, add them to the eithers list. */ + for (var = last_assignment; var < var_count; var++) { + DEBUG("Variable %u is implicitly EITHER", var); + cork_array_append(&exp->eithers, var); + } +} + + +struct ipset_expanded_assignment * +ipset_assignment_expand(const struct ipset_assignment *assignment, + ipset_variable var_count) +{ + /* First allocate the iterator itself, and all of its contained + * fields. */ + + struct ipset_expanded_assignment *exp; + unsigned int values_size = (var_count / 8) + ((var_count % 8) != 0); + + exp = cork_new(struct ipset_expanded_assignment); + exp->finished = false; + cork_buffer_init(&exp->values); + cork_buffer_ensure_size(&exp->values, values_size); + memset(exp->values.buf, 0, values_size); + cork_array_init(&exp->eithers); + + /* Then initialize the values and eithers fields. */ + initialize(exp, assignment, var_count); + return exp; +} + + +void +ipset_expanded_assignment_free(struct ipset_expanded_assignment *exp) +{ + if (exp == NULL) { + return; + } + + cork_buffer_done(&exp->values); + cork_array_done(&exp->eithers); + free(exp); +} + + +void +ipset_expanded_assignment_advance(struct ipset_expanded_assignment *exp) +{ + /* If we're already at the end of the iterator, don't do anything. */ + if (CORK_UNLIKELY(exp->finished)) { + return; + } + + DEBUG("Advancing iterator"); + + /* Look at the last EITHER bit in the assignment. If it's 0, then + * set it to 1 and return. Otherwise we set it to 0 and carry up to + * the previous indeterminate bit. */ + + size_t i; + for (i = cork_array_size(&exp->eithers); i > 0; i--) { + size_t idx = i - 1; + ipset_variable either_var = cork_array_at(&exp->eithers, idx); + DEBUG("Checking EITHER variable %u", either_var); + + if (IPSET_BIT_GET(exp->values.buf, either_var)) { + /* This variable is currently true, so set it back to false + * and carry. */ + DEBUG(" Variable %u is true, changing to false and carrying", + either_var); + IPSET_BIT_SET(exp->values.buf, either_var, false); + } else { + /* This variable is currently false, so set it to true and + * return. */ + DEBUG(" Variable %u is false, changing to true", + either_var); + IPSET_BIT_SET(exp->values.buf, either_var, true); + return; + } + } + + /* If we fall through then we've made it through all of the expanded + * assignments. */ + exp->finished = true; +} diff --git a/libipset/bdd/reachable.c b/libipset/bdd/reachable.c new file mode 100644 index 00000000..8af86246 --- /dev/null +++ b/libipset/bdd/reachable.c @@ -0,0 +1,83 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/logging.h" + + +size_t +ipset_node_reachable_count(const struct ipset_node_cache *cache, + ipset_node_id node) +{ + /* Create a set to track when we've visited a given node. */ + struct cork_hash_table *visited = cork_pointer_hash_table_new(0, 0); + + /* And a queue of nodes to check. */ + cork_array(ipset_node_id) queue; + cork_array_init(&queue); + + if (ipset_node_get_type(node) == IPSET_NONTERMINAL_NODE) { + DEBUG("Adding node %u to queue", node); + cork_array_append(&queue, node); + } + + /* And somewhere to store the result. */ + size_t node_count = 0; + + /* Check each node in turn. */ + while (!cork_array_is_empty(&queue)) { + ipset_node_id curr = cork_array_at(&queue, --queue.size); + + /* We don't have to do anything if this node is already in the + * visited set. */ + if (cork_hash_table_get(visited, (void *) (uintptr_t) curr) == NULL) { + DEBUG("Visiting node %u for the first time", curr); + + /* Add the node to the visited set. */ + cork_hash_table_put + (visited, (void *) (uintptr_t) curr, + (void *) (uintptr_t) true, NULL, NULL, NULL); + + /* Increase the node count. */ + node_count++; + + /* And add the node's nonterminal children to the visit + * queue. */ + struct ipset_node *node = + ipset_node_cache_get_nonterminal(cache, curr); + + if (ipset_node_get_type(node->low) == IPSET_NONTERMINAL_NODE) { + DEBUG("Adding node %u to queue", node->low); + cork_array_append(&queue, node->low); + } + + if (ipset_node_get_type(node->high) == IPSET_NONTERMINAL_NODE) { + DEBUG("Adding node %u to queue", node->high); + cork_array_append(&queue, node->high); + } + } + } + + /* Return the result, freeing everything before we go. */ + cork_hash_table_free(visited); + cork_array_done(&queue); + return node_count; +} + + +size_t +ipset_node_memory_size(const struct ipset_node_cache *cache, + ipset_node_id node) +{ + return ipset_node_reachable_count(cache, node) * sizeof(struct ipset_node); +} diff --git a/libipset/bdd/read.c b/libipset/bdd/read.c new file mode 100644 index 00000000..9c59a799 --- /dev/null +++ b/libipset/bdd/read.c @@ -0,0 +1,350 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include + +#include +#include +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/errors.h" +#include "ipset/logging.h" + + +static const char MAGIC_NUMBER[] = "IP set"; +static const size_t MAGIC_NUMBER_LENGTH = sizeof(MAGIC_NUMBER) - 1; + + +/** + * On disk, we use a different node ID scheme than we do in memory. + * Terminal node IDs are non-negative, and are equal to the terminal + * value. Nonterminal node IDs are negative, starting with -1. + * Nonterminal -1 appears first on disk, then nonterminal -2, and so on. + */ + +typedef int serialized_id; + + +/** + * Sets a libcork error based on the contents of errno. + */ +static void +create_errno_error(FILE *stream) +{ + if (ferror(stream)) { + cork_error_set(IPSET_ERROR, IPSET_IO_ERROR, "%s", strerror(errno)); + } else { + cork_unknown_error(); + } +} + + +/** + * Read in a big-endian uint8 from a stream. If we can't read the + * integer for some reason, return an error. + */ +static int +read_uint8(FILE *stream, uint8_t *dest) +{ + size_t num_read = fread(dest, sizeof(uint8_t), 1, stream); + if (num_read != 1) { + create_errno_error(stream); + return -1; + } + + /* for a byte, we don't need to endian-swap */ + return 0; +} + + +/** + * Read in a big-endian uint16 from a stream. If we can't read the + * integer for some reason, return an error. + */ +static uint16_t +read_uint16(FILE *stream, uint16_t *dest) +{ + size_t num_read = fread(dest, sizeof(uint16_t), 1, stream); + if (num_read != 1) { + create_errno_error(stream); + return -1; + } + + CORK_UINT16_BIG_TO_HOST_IN_PLACE(*dest); + return 0; +} + + +/** + * Read in a big-endian uint32 from a stream. If we can't read the + * integer for some reason, return an error. + */ +static uint32_t +read_uint32(FILE *stream, uint32_t *dest) +{ + size_t num_read = fread(dest, sizeof(uint32_t), 1, stream); + if (num_read != 1) { + create_errno_error(stream); + return -1; + } + + CORK_UINT32_BIG_TO_HOST_IN_PLACE(*dest); + return 0; +} + + +/** + * Read in a big-endian uint64 from a stream. If we can't read the + * integer for some reason, return an error. + */ +static uint64_t +read_uint64(FILE *stream, uint64_t *dest) +{ + size_t num_read = fread(dest, sizeof(uint64_t), 1, stream); + if (num_read != 1) { + create_errno_error(stream); + return -1; + } + + CORK_UINT64_BIG_TO_HOST_IN_PLACE(*dest); + return 0; +} + + +/** + * A helper function that verifies that we've read exactly as many bytes + * as we should, returning an error otherwise. + */ +static int +verify_cap(size_t bytes_read, size_t cap) +{ + if (bytes_read < cap) { + /* There's extra data at the end of the stream. */ + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "Malformed set: extra data at end of stream."); + return -1; + } else if (bytes_read > cap) { + /* We read more data than we were supposed to. */ + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "Malformed set: read too much data."); + return -1; + } + + return 0; +} + +/** + * A helper function for reading a version 1 BDD stream. + */ +static ipset_node_id +load_v1(FILE *stream, struct ipset_node_cache *cache) +{ + DEBUG("Stream contains v1 IP set"); + ipset_node_id result; + struct cork_hash_table *cache_ids = cork_pointer_hash_table_new(0, 0); + + /* We've already read in the magic number and version. Next should + * be the length of the encoded set. */ + uint64_t length; + DEBUG("Reading encoded length"); + ei_check(read_uint64(stream, &length)); + + /* The length includes the magic number, version number, and the + * length field itself. Remove those to get the cap on the + * remaining stream. */ + + size_t bytes_read = 0; + size_t cap = length - + MAGIC_NUMBER_LENGTH - + sizeof(uint16_t) - + sizeof(uint64_t); + + DEBUG("Length cap is %zu bytes.", cap); + + /* Read in the number of nonterminals. */ + + uint32_t nonterminal_count; + DEBUG("Reading number of nonterminals"); + ei_check(read_uint32(stream, &nonterminal_count)); + bytes_read += sizeof(uint32_t); + + /* If there are no nonterminals, then there's only a single terminal + * left to read. */ + + if (nonterminal_count == 0) { + uint32_t value; + DEBUG("Reading single terminal value"); + ei_check(read_uint32(stream, &value)); + bytes_read += sizeof(uint32_t); + + /* We should have reached the end of the encoded set. */ + ei_check(verify_cap(bytes_read, cap)); + + /* Create a terminal node for this value and return it. */ + cork_hash_table_free(cache_ids); + return ipset_terminal_node_id(value); + } + + /* Otherwise, read in each nonterminal. We need to keep track of a + * mapping between each nonterminal's ID in the stream (which are + * number consecutively from -1), and its ID in the node cache + * (which could be anything). */ + + size_t i; + for (i = 0; i < nonterminal_count; i++) { + serialized_id serialized_id = -(i+1); + + /* Each serialized node consists of a variable index, a low + * pointer, and a high pointer. */ + + uint8_t variable; + ei_check(read_uint8(stream, &variable)); + bytes_read += sizeof(uint8_t); + + int32_t low; + ei_check(read_uint32(stream, (uint32_t *) &low)); + bytes_read += sizeof(int32_t); + + int32_t high; + ei_check(read_uint32(stream, (uint32_t *) &high)); + bytes_read += sizeof(int32_t); + + DEBUG("Read serialized node %d = (x%d? %" PRId32 ": %" PRId32 ")", + serialized_id, variable, high, low); + + /* Turn the low pointer into a node ID. If the pointer is >= 0, + * it's a terminal value. Otherwise, its a nonterminal ID, + * indexing into the serialized nonterminal array.*/ + + ipset_node_id low_id; + + if (low >= 0) { + low_id = ipset_terminal_node_id(low); + } else { + /* The file format guarantees that any node reference points + * to a node earlier in the serialized array. That means we + * can assume that cache_ids has already been filled in for + * this node. */ + + low_id = (ipset_node_id) (uintptr_t) + cork_hash_table_get(cache_ids, (void *) (intptr_t) low); + + DEBUG(" Serialized ID %" PRId32 " is internal ID %u", + low, low_id); + } + + /* Do the same for the high pointer. */ + + ipset_node_id high_id; + + if (high >= 0) { + high_id = ipset_terminal_node_id(high); + } else { + /* The file format guarantees that any node reference points + * to a node earlier in the serialized array. That means we + * can assume that cache_ids has already been filled in for + * this node. */ + + high_id = (ipset_node_id) (uintptr_t) + cork_hash_table_get(cache_ids, (void *) (intptr_t) high); + + DEBUG(" Serialized ID %" PRId32 " is internal ID %u", + high, high_id); + } + + /* Create a nonterminal node in the node cache. */ + result = ipset_node_cache_nonterminal + (cache, variable, low_id, high_id); + + DEBUG("Internal node %u = nonterminal(x%d? %u: %u)", + result, (int) variable, high_id, low_id); + + /* Remember the internal node ID for this new node, in case any + * later serialized nodes point to it. */ + + cork_hash_table_put + (cache_ids, (void *) (intptr_t) serialized_id, + (void *) (uintptr_t) result, NULL, NULL, NULL); + } + + /* We should have reached the end of the encoded set. */ + ei_check(verify_cap(bytes_read, cap)); + + /* The last node is the nonterminal for the entire set. */ + cork_hash_table_free(cache_ids); + return result; + + error: + /* If there's an error, clean up the objects that we've created + * before returning. */ + + cork_hash_table_free(cache_ids); + return 0; +} + + +ipset_node_id +ipset_node_cache_load(FILE *stream, struct ipset_node_cache *cache) +{ + size_t bytes_read; + + /* First, read in the magic number from the stream to ensure that + * this is an IP set. */ + + uint8_t magic[MAGIC_NUMBER_LENGTH]; + + DEBUG("Reading IP set magic number"); + bytes_read = fread(magic, 1, MAGIC_NUMBER_LENGTH, stream); + + if (ferror(stream)) { + create_errno_error(stream); + return 0; + } + + if (bytes_read != MAGIC_NUMBER_LENGTH) { + /* We reached EOF before reading the entire magic number. */ + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "Unexpected end of file"); + return 0; + } + + if (memcmp(magic, MAGIC_NUMBER, MAGIC_NUMBER_LENGTH) != 0) { + /* The magic number doesn't match, so this isn't a BDD. */ + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "Magic number doesn't match; this isn't an IP set."); + return 0; + } + + /* Read in the version number and dispatch to the right reading + * function. */ + + uint16_t version; + DEBUG("Reading IP set version"); + xi_check(0, read_uint16(stream, &version)); + + switch (version) { + case 0x0001: + return load_v1(stream, cache); + + default: + /* We don't know how to read this version number. */ + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "Unknown version number %" PRIu16, version); + return 0; + } +} diff --git a/libipset/bdd/write.c b/libipset/bdd/write.c new file mode 100644 index 00000000..0b5633ee --- /dev/null +++ b/libipset/bdd/write.c @@ -0,0 +1,556 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/logging.h" + + +/*----------------------------------------------------------------------- + * Generic saving logic + */ + +/** + * On disk, we use a different node ID scheme than we do in memory. + * Terminal node IDs are non-negative, and are equal to the terminal + * value. Nonterminal node IDs are negative, starting with -1. + * Nonterminal -1 appears first on disk, then nonterminal -2, and so + * on. + */ + +typedef int serialized_id; + + +/* forward declaration */ +struct save_data; + + +/** + * A callback that outputs any necessary header. Should return an int + * status code indicating whether the write was successful. + */ + +typedef int +(*write_header_func)(struct save_data *save_data, + struct ipset_node_cache *cache, + ipset_node_id root); + + +/** + * A callback that outputs any necessary footer. Should return an int + * status code indicating whether the write was successful. + */ + +typedef int +(*write_footer_func)(struct save_data *save_data, + struct ipset_node_cache *cache, + ipset_node_id root); + + +/** + * A callback that actually outputs a terminal node to disk. Should + * return an int status code indicating whether the write was successful. + */ + +typedef int +(*write_terminal_func)(struct save_data *save_data, + ipset_value terminal_value); + + +/** + * A callback that actually outputs a nonterminal node to disk. + * Should return an int status code indicating whether the write was + * successful. + */ + +typedef int +(*write_nonterminal_func)(struct save_data *save_data, + serialized_id serialized_node, + ipset_variable variable, + serialized_id serialized_low, + serialized_id serialized_high); + + +/** + * A helper struct containing all of the persistent data items needed + * during the execution of a save. + */ + +struct save_data { + /* The node cache that we're saving nodes from. */ + struct ipset_node_cache *cache; + + /* The output stream to save the data to. */ + struct cork_stream_consumer *stream; + + /* The cache of serialized IDs for any nonterminals that we've + * encountered so far. */ + struct cork_hash_table *serialized_ids; + + /* The serialized ID to use for the next nonterminal that we + * encounter. */ + serialized_id next_serialized_id; + + /* The callback used to write the file header to the stream. */ + write_header_func write_header; + + /* The callback used to write the file footer to the stream. */ + write_footer_func write_footer; + + /* The callback used to write terminals to the stream. */ + write_terminal_func write_terminal; + + /* The callback used to write nonterminals to the stream. */ + write_nonterminal_func write_nonterminal; + + /* A pointer to any additional data needed by the callbacks. */ + void *user_data; +}; + + +/** + * A helper function for ipset_node_save(). Outputs a nonterminal + * node in a BDD tree, if we haven't done so already. Ensures that + * the children of the nonterminal are output before the nonterminal + * is. Returns the serialized ID of this node. + */ + +static int +save_visit_node(struct save_data *save_data, + ipset_node_id node_id, serialized_id *dest) +{ + /* Check whether we've already serialized this node. */ + + struct cork_hash_table_entry *entry; + bool is_new; + entry = cork_hash_table_get_or_create + (save_data->serialized_ids, (void *) (uintptr_t) node_id, &is_new); + + if (!is_new) { + *dest = (intptr_t) entry->value; + return 0; + } else { + if (ipset_node_get_type(node_id) == IPSET_TERMINAL_NODE) { + /* For terminals, there isn't really anything to do — we + * just output the terminal node and use its value as the + * serialized ID. */ + + ipset_value value = ipset_terminal_value(node_id); + + DEBUG("Writing terminal(%d)", value); + rii_check(save_data->write_terminal(save_data, value)); + entry->value = (void *) (intptr_t) value; + *dest = value; + return 0; + } else { + /* For nonterminals, we drill down into the node's children + * first, then output the nonterminal node. */ + + struct ipset_node *node = + ipset_node_cache_get_nonterminal(save_data->cache, node_id); + DEBUG("Visiting node %u nonterminal(x%u? %u: %u)", + node_id, node->variable, node->high, node->low); + + /* Output the node's nonterminal children before we output + * the node itself. */ + serialized_id serialized_low; + serialized_id serialized_high; + rii_check(save_visit_node(save_data, node->low, &serialized_low)); + rii_check(save_visit_node(save_data, node->high, &serialized_high)); + + /* Output the nonterminal */ + serialized_id result = save_data->next_serialized_id--; + DEBUG("Writing node %u as serialized node %d = (x%u? %d: %d)", + node_id, result, + node->variable, serialized_low, serialized_high); + + entry->value = (void *) (intptr_t) result; + *dest = result; + return save_data->write_nonterminal + (save_data, result, node->variable, + serialized_low, serialized_high); + } + } +} + + +static int +save_bdd(struct save_data *save_data, + struct ipset_node_cache *cache, ipset_node_id root) +{ + /* First, output the file header. */ + + DEBUG("Writing file header"); + rii_check(save_data->write_header(save_data, cache, root)); + + /* The serialized node IDs are different than the in-memory node + * IDs. This means that, for our nonterminal nodes, we need a + * mapping from internal node ID to serialized node ID. */ + + DEBUG("Creating file caches"); + save_data->serialized_ids = cork_pointer_hash_table_new(0, 0); + save_data->next_serialized_id = -1; + + /* Trace down through the BDD tree, outputting each terminal and + * nonterminal node as they're encountered. */ + + DEBUG("Writing nodes"); + + serialized_id last_serialized_id; + ei_check(save_visit_node(save_data, root, &last_serialized_id)); + + /* Finally, output the file footer and cleanup. */ + + DEBUG("Writing file footer"); + ei_check(save_data->write_footer(save_data, cache, root)); + + DEBUG("Freeing file caches"); + cork_hash_table_free(save_data->serialized_ids); + return 0; + + error: + /* If there's an error, clean up the objects that we've created + * before returning. */ + cork_hash_table_free(save_data->serialized_ids); + return -1; +} + + +/*----------------------------------------------------------------------- + * Helper functions + */ + +/** + * Write a NUL-terminated string to a stream. If we can't write the + * string for some reason, return an error. + */ +static int +write_string(struct cork_stream_consumer *stream, const char *str) +{ + size_t len = strlen(str); + return cork_stream_consumer_data(stream, str, len, false); +} + + +/** + * Write a big-endian uint8 to a stream. If we can't write the + * integer for some reason, return an error. + */ +static int +write_uint8(struct cork_stream_consumer *stream, uint8_t val) +{ + /* for a byte, we don't need to endian-swap */ + return cork_stream_consumer_data(stream, &val, sizeof(uint8_t), false); +} + + +/** + * Write a big-endian uint16 to a stream. If we can't write the + * integer for some reason, return an error. + */ +static int +write_uint16(struct cork_stream_consumer *stream, uint16_t val) +{ + CORK_UINT16_HOST_TO_BIG_IN_PLACE(val); + return cork_stream_consumer_data(stream, &val, sizeof(uint16_t), false); +} + + +/** + * Write a big-endian uint32 to a stream. If we can't write the + * integer for some reason, return an error. + */ + +static int +write_uint32(struct cork_stream_consumer *stream, uint32_t val) +{ + CORK_UINT32_HOST_TO_BIG_IN_PLACE(val); + return cork_stream_consumer_data(stream, &val, sizeof(uint32_t), false); +} + + +/** + * Write a big-endian uint64 to a stream. If we can't write the + * integer for some reason, return an error. + */ + +static int +write_uint64(struct cork_stream_consumer *stream, uint64_t val) +{ + CORK_UINT64_HOST_TO_BIG_IN_PLACE(val); + return cork_stream_consumer_data(stream, &val, sizeof(uint64_t), false); +} + + +/*----------------------------------------------------------------------- + * V1 BDD file + */ + +static const char MAGIC_NUMBER[] = "IP set"; +static const size_t MAGIC_NUMBER_LENGTH = sizeof(MAGIC_NUMBER) - 1; + + +static int +write_header_v1(struct save_data *save_data, + struct ipset_node_cache *cache, ipset_node_id root) +{ + /* Output the magic number for an IP set, and the file format + * version that we're going to write. */ + rii_check(cork_stream_consumer_data(save_data->stream, NULL, 0, true)); + rii_check(write_string(save_data->stream, MAGIC_NUMBER)); + rii_check(write_uint16(save_data->stream, 0x0001)); + + /* Determine how many reachable nodes there are, to calculate the + * size of the set. */ + size_t nonterminal_count = ipset_node_reachable_count(cache, root); + size_t set_size = + MAGIC_NUMBER_LENGTH + /* magic number */ + sizeof(uint16_t) + /* version number */ + sizeof(uint64_t) + /* length of set */ + sizeof(uint32_t) + /* number of nonterminals */ + (nonterminal_count * /* for each nonterminal: */ + (sizeof(uint8_t) + /* variable number */ + sizeof(uint32_t) + /* low pointer */ + sizeof(uint32_t) /* high pointer */ + )); + + /* If the root is a terminal, we need to add 4 bytes to the set + * size, for storing the terminal value. */ + if (ipset_node_get_type(root) == IPSET_TERMINAL_NODE) { + set_size += sizeof(uint32_t); + } + + rii_check(write_uint64(save_data->stream, set_size)); + rii_check(write_uint32(save_data->stream, nonterminal_count)); + return 0; +} + + +static int +write_footer_v1(struct save_data *save_data, + struct ipset_node_cache *cache, ipset_node_id root) +{ + /* If the root is a terminal node, then we output the terminal value + * in place of the (nonexistent) list of nonterminal nodes. */ + + if (ipset_node_get_type(root) == IPSET_TERMINAL_NODE) { + ipset_value value = ipset_terminal_value(root); + return write_uint32(save_data->stream, value); + } + + return 0; +} + + +static int +write_terminal_v1(struct save_data *save_data, ipset_value terminal_value) +{ + /* We don't have to write anything out for a terminal in a V1 file, + * since the terminal's value will be encoded into the node ID + * wherever it's used. */ + return 0; +} + + +static int +write_nonterminal_v1(struct save_data *save_data, + serialized_id serialized_node, + ipset_variable variable, + serialized_id serialized_low, + serialized_id serialized_high) +{ + rii_check(write_uint8(save_data->stream, variable)); + rii_check(write_uint32(save_data->stream, serialized_low)); + rii_check(write_uint32(save_data->stream, serialized_high)); + return 0; +} + + +int +ipset_node_cache_save(struct cork_stream_consumer *stream, struct ipset_node_cache *cache, + ipset_node_id node) +{ + struct save_data save_data; + save_data.cache = cache; + save_data.stream = stream; + save_data.write_header = write_header_v1; + save_data.write_footer = write_footer_v1; + save_data.write_terminal = write_terminal_v1; + save_data.write_nonterminal = write_nonterminal_v1; + return save_bdd(&save_data, cache, node); +} + + +/*----------------------------------------------------------------------- + * GraphViz dot file + */ + +static const char *GRAPHVIZ_HEADER = + "strict digraph bdd {\n"; + +static const char *GRAPHVIZ_FOOTER = + "}\n"; + + +struct dot_data { + /* The terminal value to leave out of the dot file. This should be + * the default value of the set or map. */ + ipset_value default_value; + + /* A scratch buffer */ + struct cork_buffer scratch; +}; + + +static int +write_header_dot(struct save_data *save_data, + struct ipset_node_cache *cache, ipset_node_id root) +{ + /* Output the opening clause of the GraphViz script. */ + rii_check(cork_stream_consumer_data(save_data->stream, NULL, 0, true)); + return write_string(save_data->stream, GRAPHVIZ_HEADER); +} + + +static int +write_footer_dot(struct save_data *save_data, + struct ipset_node_cache *cache, ipset_node_id root) +{ + /* Output the closing clause of the GraphViz script. */ + return write_string(save_data->stream, GRAPHVIZ_FOOTER); +} + + +static int +write_terminal_dot(struct save_data *save_data, ipset_value terminal_value) +{ + struct dot_data *dot_data = save_data->user_data; + + /* If this terminal has the default value, skip it. */ + if (terminal_value == dot_data->default_value) { + return 0; + } + + /* Output a node for the terminal value. */ + cork_buffer_printf + (&dot_data->scratch, + " t%d [shape=box, label=%d];\n", + terminal_value, terminal_value); + return write_string(save_data->stream, dot_data->scratch.buf); +} + + +static int +write_nonterminal_dot(struct save_data *save_data, + serialized_id serialized_node, + ipset_variable variable, + serialized_id serialized_low, + serialized_id serialized_high) +{ + struct dot_data *dot_data = save_data->user_data; + + /* Include a node for the nonterminal value. */ + cork_buffer_printf + (&dot_data->scratch, + " n%d [shape=circle,label=%u];\n", + (-serialized_node), variable); + + /* Include an edge for the low pointer. */ + if (serialized_low < 0) { + /* The low pointer is a nonterminal. */ + cork_buffer_append_printf + (&dot_data->scratch, + " n%d -> n%d", + (-serialized_node), (-serialized_low)); + } else { + /* The low pointer is a terminal. */ + ipset_value low_value = (ipset_value) serialized_low; + + if (low_value == dot_data->default_value) { + /* The terminal is the default value, so instead of a real + * terminal, connect this pointer to a dummy circle node. */ + cork_buffer_append_printf + (&dot_data->scratch, + " low%d [shape=circle,label=\"\"]\n" + " n%d -> low%d", + (-serialized_node), (-serialized_node), (-serialized_node)); + } else { + /* The terminal isn't a default, so go ahead and output it. */ + cork_buffer_append_printf + (&dot_data->scratch, + " n%d -> t%d", + (-serialized_node), serialized_low); + } + } + + cork_buffer_append_printf + (&dot_data->scratch, " [style=dashed,color=red]\n"); + + /* Include an edge for the high pointer. */ + if (serialized_high < 0) { + /* The high pointer is a nonterminal. */ + cork_buffer_append_printf + (&dot_data->scratch, + " n%d -> n%d", + (-serialized_node), (-serialized_high)); + } else { + /* The high pointer is a terminal. */ + ipset_value high_value = (ipset_value) serialized_high; + + if (high_value == dot_data->default_value) { + /* The terminal is the default value, so instead of a real + * terminal, connect this pointer to a dummy circle node. */ + cork_buffer_append_printf + (&dot_data->scratch, + " high%d " + "[shape=circle," + "fixedsize=true," + "height=0.25," + "width=0.25," + "label=\"\"]\n" + " n%d -> high%d", + (-serialized_node), (-serialized_node), (-serialized_node)); + } else { + /* The terminal isn't a default, so go ahead and output it. */ + cork_buffer_append_printf + (&dot_data->scratch, + " n%d -> t%d", + (-serialized_node), serialized_high); + } + } + + cork_buffer_append_printf + (&dot_data->scratch, " [style=solid,color=black]\n"); + + /* Output the clauses to the stream. */ + return write_string(save_data->stream, dot_data->scratch.buf); +} + + +int +ipset_node_cache_save_dot(struct cork_stream_consumer *stream, + struct ipset_node_cache *cache, ipset_node_id node) +{ + struct dot_data dot_data = { + 0 /* default value */ + }; + + struct save_data save_data; + save_data.cache = cache; + save_data.stream = stream; + save_data.write_header = write_header_dot; + save_data.write_footer = write_footer_dot; + save_data.write_terminal = write_terminal_dot; + save_data.write_nonterminal = write_nonterminal_dot; + save_data.user_data = &dot_data; + return save_bdd(&save_data, cache, node); +} diff --git a/libipset/general.c b/libipset/general.c new file mode 100644 index 00000000..82d3f924 --- /dev/null +++ b/libipset/general.c @@ -0,0 +1,21 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/ipset.h" + + +int +ipset_init_library() +{ + return 0; +} diff --git a/libipset/include/ipset/bdd/nodes.h b/libipset/include/ipset/bdd/nodes.h new file mode 100644 index 00000000..18548286 --- /dev/null +++ b/libipset/include/ipset/bdd/nodes.h @@ -0,0 +1,536 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2013, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef IPSET_BDD_NODES_H +#define IPSET_BDD_NODES_H + + +#include + +#include +#include + + +/*----------------------------------------------------------------------- + * Preliminaries + */ + +/** + * Each variable in a BDD is referred to by number. + */ +typedef unsigned int ipset_variable; + + +/** + * Each BDD terminal represents an integer value. The integer must be + * non-negative, but must be within the range of the signed + * integer type. + */ +typedef unsigned int ipset_value; + + +/** + * An identifier for each distinct node in a BDD. + * + * Internal implementation note. Since pointers are aligned to at + * least two bytes, the ID of a terminal node has its LSB set to 1, + * and has the terminal value stored in the remaining bits. The ID of + * a nonterminal node is simply a pointer to the node struct. + */ +typedef unsigned int ipset_node_id; + + +/** + * Nodes can either be terminal or nonterminal. + */ +enum ipset_node_type { + IPSET_NONTERMINAL_NODE = 0, + IPSET_TERMINAL_NODE = 1 +}; + + +/** + * Return the type of node represented by a particular node ID. + */ +#define ipset_node_get_type(node_id) ((node_id) & 0x01) + +#define IPSET_NODE_ID_FORMAT "%s%u" +#define IPSET_NODE_ID_VALUES(node_id) \ + (ipset_node_get_type((node_id)) == IPSET_NONTERMINAL_NODE? "s": ""), \ + ((node_id) >> 1) + + +/*----------------------------------------------------------------------- + * Terminal nodes + */ + +/** + * Return the value of a terminal node. The result is undefined if + * the node ID represents a nonterminal. + */ +#define ipset_terminal_value(node_id) ((node_id) >> 1) + +/** + * Creates a terminal node ID from a terminal value. + */ +#define ipset_terminal_node_id(value) \ + (((value) << 1) | IPSET_TERMINAL_NODE) + + +/*----------------------------------------------------------------------- + * Nonterminal nodes + */ + +/** + * A nonterminal BDD node. This is an inner node of the BDD tree. + * The node represents one variable in an overall variable assignment. + * The node has two children: a “low” child and a “high” child. The + * low child is the subtree that applies when the node's variable is + * false or 0; the high child is the subtree that applies when it's + * true or 1. + * + * This type does not take care of ensuring that all BDD nodes are + * reduced; that is handled by the node_cache class. + */ +struct ipset_node { + /** The reference count for this node. */ + unsigned int refcount; + /** The variable that this node represents. */ + ipset_variable variable; + /** The subtree node for when the variable is false. */ + ipset_node_id low; + /** The subtree node for when the variable is true. */ + ipset_node_id high; +}; + +/** + * Return the "value" of a nonterminal node. The value of a nonterminal + * is the index into the node array of the cache that the node belongs + * to. + */ +#define ipset_nonterminal_value(node_id) ((node_id) >> 1) + +/** + * Creates a nonterminal node ID from a nonterminal value. + */ +#define ipset_nonterminal_node_id(value) \ + (((value) << 1) | IPSET_NONTERMINAL_NODE) + +/** + * Print out a node object. + */ +void +ipset_node_fprint(FILE *stream, struct ipset_node *node); + + +/*----------------------------------------------------------------------- + * Node caches + */ + +/** + * The log2 of the size of each chunk of BDD nodes. + */ +/* 16K elements per cache */ +#define IPSET_BDD_NODE_CACHE_BIT_SIZE 6 +#define IPSET_BDD_NODE_CACHE_SIZE (1 << IPSET_BDD_NODE_CACHE_BIT_SIZE) +#define IPSET_BDD_NODE_CACHE_MASK (IPSET_BDD_NODE_CACHE_SIZE - 1) + +/** + * A cache for BDD nodes. By creating and retrieving nodes through + * the cache, we ensure that a BDD is reduced. + */ +struct ipset_node_cache { + /** The storage for the nodes managed by this cache. */ + cork_array(struct ipset_node *) chunks; + /** The largest nonterminal index that has been handed out. */ + ipset_value largest_index; + /** The index of the first node in the free list. */ + ipset_value free_list; + /** A cache of the nonterminal nodes, keyed by their contents. */ + struct cork_hash_table *node_cache; +}; + +/** + * Returns the index of the chunk that the given nonterminal lives in. + */ +#define ipset_nonterminal_chunk_index(index) \ + ((index) >> IPSET_BDD_NODE_CACHE_BIT_SIZE) + +/** + * Returns the offset of the given nonterminal within its chunk. + */ +#define ipset_nonterminal_chunk_offset(index) \ + ((index) & IPSET_BDD_NODE_CACHE_MASK) + +/** + * Returns a pointer to the ipset_node for a given nonterminal index. + */ +#define ipset_node_cache_get_nonterminal_by_index(cache, index) \ + (&cork_array_at(&(cache)->chunks, ipset_nonterminal_chunk_index((index))) \ + [ipset_nonterminal_chunk_offset((index))]) + +/** + * Returns the ipset_node for a given nonterminal node ID. + */ +#define ipset_node_cache_get_nonterminal(cache, node_id) \ + (ipset_node_cache_get_nonterminal_by_index \ + ((cache), ipset_nonterminal_value((node_id)))) + +/** + * Create a new node cache. + */ +struct ipset_node_cache * +ipset_node_cache_new(void); + +/** + * Free a node cache. + */ +void +ipset_node_cache_free(struct ipset_node_cache *cache); + +/** + * Create a new nonterminal node with the given contents, returning + * its ID. This function ensures that there is only one node with the + * given contents in this cache. + * + * Steals references to low and high. + */ +ipset_node_id +ipset_node_cache_nonterminal(struct ipset_node_cache *cache, + ipset_variable variable, + ipset_node_id low, ipset_node_id high); + + +/** + * Increment the reference count of a nonterminal node. (This is a + * no-op for terminal nodes.) + */ +ipset_node_id +ipset_node_incref(struct ipset_node_cache *cache, ipset_node_id node); + +/** + * Decrement the reference count of a nonterminal node. If the + * reference count reaches 0, the storage for the node will be + * reclaimed. (This is a no-op for terminal nodes.) + */ +void +ipset_node_decref(struct ipset_node_cache *cache, ipset_node_id node); + + +/** + * Return the number of nodes that are reachable from the given node. + * This does not include duplicates if a node is reachable via more + * than one path. + */ +size_t +ipset_node_reachable_count(const struct ipset_node_cache *cache, + ipset_node_id node); + + +/** + * Return the amount of memory used by the nodes in the given BDD. + */ +size_t +ipset_node_memory_size(const struct ipset_node_cache *cache, + ipset_node_id node); + + +/** + * Load a BDD from an input stream. The error field is filled in with + * an error condition is the BDD can't be read for any reason. + */ +ipset_node_id +ipset_node_cache_load(FILE *stream, struct ipset_node_cache *cache); + + +/** + * Save a BDD to an output stream. This encodes the set using only + * those nodes that are reachable from the BDD's root node. + */ +int +ipset_node_cache_save(struct cork_stream_consumer *stream, + struct ipset_node_cache *cache, ipset_node_id node); + + +/** + * Compare two BDD nodes, possibly from different caches, for equality. + */ +bool +ipset_node_cache_nodes_equal(const struct ipset_node_cache *cache1, + ipset_node_id node1, + const struct ipset_node_cache *cache2, + ipset_node_id node2); + + +/** + * Save a GraphViz dot graph for a BDD. The graph script is written + * to the given output stream. This graph only includes those nodes + * that are reachable from the BDD's root node. + */ +int +ipset_node_cache_save_dot(struct cork_stream_consumer *stream, + struct ipset_node_cache *cache, ipset_node_id node); + + +/*----------------------------------------------------------------------- + * BDD operators + */ + +/** + * A function that provides the value for each variable in a BDD. + */ +typedef bool +(*ipset_assignment_func)(const void *user_data, + ipset_variable variable); + +/** + * An assignment function that gets the variable values from an array + * of gbooleans. + */ +bool +ipset_bool_array_assignment(const void *user_data, + ipset_variable variable); + +/** + * An assignment function that gets the variable values from an array + * of bits. + */ +bool +ipset_bit_array_assignment(const void *user_data, + ipset_variable variable); + +/** + * Evaluate a BDD given a particular assignment of variables. + */ +ipset_value +ipset_node_evaluate(const struct ipset_node_cache *cache, ipset_node_id node, + ipset_assignment_func assignment, + const void *user_data); + +/** + * Add an assignment to the BDD. + */ +ipset_node_id +ipset_node_insert(struct ipset_node_cache *cache, ipset_node_id node, + ipset_assignment_func assignment, + const void *user_data, ipset_variable variable_count, + ipset_value value); + + +/*----------------------------------------------------------------------- + * Variable assignments + */ + +/** + * Each variable in the input to a Boolean function can be true or + * false; it can also be EITHER, which means that the variable can be + * either true or false in a particular assignment without affecting + * the result of the function. + */ +enum ipset_tribool { + IPSET_FALSE = 0, + IPSET_TRUE = 1, + IPSET_EITHER = 2 +}; + + +/** + * An assignment is a mapping of variable numbers to Boolean values. + * It represents an input to a Boolean function that maps to a + * particular output value. Each variable in the input to a Boolean + * function can be true or false; it can also be EITHER, which means + * that the variable can be either true or false in a particular + * assignment without affecting the result of the function. + */ + +struct ipset_assignment { + /** + * The underlying variable assignments are stored in a vector of + * tribools. Every variable that has a true or false value must + * appear in the vector. Variables that are EITHER only have to + * appear to prevent gaps in the vector. Any variables outside + * the range of the vector are assumed to be EITHER. + */ + cork_array(enum ipset_tribool) values; +}; + + +/** + * Create a new assignment where all variables are indeterminite. + */ +struct ipset_assignment * +ipset_assignment_new(); + + +/** + * Free an assignment. + */ +void +ipset_assignment_free(struct ipset_assignment *assignment); + + +/** + * Compare two assignments for equality. + */ +bool +ipset_assignment_equal(const struct ipset_assignment *assignment1, + const struct ipset_assignment *assignment2); + + +/** + * Set the given variable, and all higher variables, to the EITHER + * value. + */ +void +ipset_assignment_cut(struct ipset_assignment *assignment, ipset_variable var); + + +/** + * Clear the assignment, setting all variables to the EITHER value. + */ +void +ipset_assignment_clear(struct ipset_assignment *assignment); + + +/** + * Return the value assigned to a particular variable. + */ +enum ipset_tribool +ipset_assignment_get(struct ipset_assignment *assignment, ipset_variable var); + + +/** + * Set the value assigned to a particular variable. + */ +void +ipset_assignment_set(struct ipset_assignment *assignment, + ipset_variable var, enum ipset_tribool value); + + +/*----------------------------------------------------------------------- + * Expanded assignments + */ + +/** + * An iterator for expanding a variable assignment. For each EITHER + * variable in the assignment, the iterator yields a result with both + * values. + */ +struct ipset_expanded_assignment { + /** Whether there are any more assignments in this iterator. */ + bool finished; + + /** + * The variable values in the current expanded assignment. Since + * there won't be any EITHERs in the expanded assignment, we can + * use a byte array, and represent each variable by a single bit. + */ + struct cork_buffer values; + + /** + * An array containing all of the variables that are EITHER in the + * original assignment. + */ + cork_array(ipset_variable) eithers; +}; + + +/** + * Return an iterator that expands a variable assignment. For each + * variable that's EITHER in the assignment, the iterator yields a + * result with both values. The iterator will ensure that the + * specified number of variables are given concrete values. + */ +struct ipset_expanded_assignment * +ipset_assignment_expand(const struct ipset_assignment *assignment, + ipset_variable var_count); + + +/** + * Free an expanded assignment iterator. + */ +void +ipset_expanded_assignment_free(struct ipset_expanded_assignment *exp); + + +/** + * Advance the iterator to the next assignment. + */ +void +ipset_expanded_assignment_advance(struct ipset_expanded_assignment *exp); + + +/*----------------------------------------------------------------------- + * BDD iterators + */ + +/** + * An iterator for walking through the assignments for a given BDD + * node. + * + * The iterator walks through each path in the BDD tree, stopping at + * each terminal node. Each time we reach a terminal node, we yield a + * new ipset_assignment object representing the assignment of variables + * along the current path. + * + * We maintain a stack of nodes leading to the current terminal, which + * allows us to backtrack up the path to find the next terminal when + * we increment the iterator. + */ +struct ipset_bdd_iterator { + /** Whether there are any more assignments in this iterator. */ + bool finished; + + /** The node cache that we're iterating through. */ + struct ipset_node_cache *cache; + + /** + * The sequence of nonterminal nodes leading to the current + * terminal. + */ + cork_array(ipset_node_id) stack; + + /** The current assignment. */ + struct ipset_assignment *assignment; + + /** + * The value of the BDD's function when applied to the current + * assignment. + */ + ipset_value value; +}; + + +/** + * Return an iterator that yields all of the assignments in the given + * BDD. The iterator contains two items of interest. The first is an + * ipset_assignment providing the value that each variable takes, while + * the second is the terminal value that is the result of the BDD's + * function when applied to that variable assignment. + */ +struct ipset_bdd_iterator * +ipset_node_iterate(struct ipset_node_cache *cache, ipset_node_id root); + + +/** + * Free a BDD iterator. + */ +void +ipset_bdd_iterator_free(struct ipset_bdd_iterator *iterator); + + +/** + * Advance the iterator to the next assignment. + */ +void +ipset_bdd_iterator_advance(struct ipset_bdd_iterator *iterator); + + +#endif /* IPSET_BDD_NODES_H */ diff --git a/libipset/include/ipset/bits.h b/libipset/include/ipset/bits.h new file mode 100644 index 00000000..a534605a --- /dev/null +++ b/libipset/include/ipset/bits.h @@ -0,0 +1,58 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef IPSET_BITS_H +#define IPSET_BITS_H + +#include + +/*----------------------------------------------------------------------- + * Bit arrays + */ + +/** + * Extract the byte that contains a particular bit in an array. + */ +#define IPSET_BIT_GET_BYTE(array, i) \ + (((uint8_t *) (array))[(i) / 8]) + +/** + * Create a bit mask that extracts a particular bit from the byte that + * it lives in. + */ +#define IPSET_BIT_ON_MASK(i) \ + (0x80 >> ((i) % 8)) + +/** + * Create a bit mask that extracts everything except for a particular + * bit from the byte that it lives in. + */ +#define IPSET_BIT_NEG_MASK(i) \ + (~IPSET_BIT_ON_MASK(i)) + +/** + * Return whether a particular bit is set in a byte array. Bits are + * numbered from 0, in a big-endian order. + */ +#define IPSET_BIT_GET(array, i) \ + ((IPSET_BIT_GET_BYTE(array, i) & \ + IPSET_BIT_ON_MASK(i)) != 0) + +/** + * Set (or unset) a particular bit is set in a byte array. Bits are + * numbered from 0, in a big-endian order. + */ +#define IPSET_BIT_SET(array, i, val) \ + (IPSET_BIT_GET_BYTE(array, i) = \ + (IPSET_BIT_GET_BYTE(array, i) & IPSET_BIT_NEG_MASK(i)) \ + | ((val)? IPSET_BIT_ON_MASK(i): 0)) + + +#endif /* IPSET_BITS_H */ diff --git a/libipset/include/ipset/errors.h b/libipset/include/ipset/errors.h new file mode 100644 index 00000000..ed178b43 --- /dev/null +++ b/libipset/include/ipset/errors.h @@ -0,0 +1,31 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef IPSET_ERRORS_H +#define IPSET_ERRORS_H + + +#include + + +/*----------------------------------------------------------------------- + * Error reporting + */ + +/* Hash of "ipset.h" */ +#define IPSET_ERROR 0xf2000181 + +enum ipset_error { + IPSET_IO_ERROR, + IPSET_PARSE_ERROR +}; + + +#endif /* IPSET_ERRORS_H */ diff --git a/libipset/include/ipset/ipset.h b/libipset/include/ipset/ipset.h new file mode 100644 index 00000000..cbb435fa --- /dev/null +++ b/libipset/include/ipset/ipset.h @@ -0,0 +1,265 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef IPSET_IPSET_H +#define IPSET_IPSET_H + +#include + +#include +#include + +#include + + +struct ip_set { + struct ipset_node_cache *cache; + ipset_node_id set_bdd; +}; + + +struct ip_map { + struct ipset_node_cache *cache; + ipset_node_id map_bdd; + ipset_node_id default_bdd; +}; + + +/*--------------------------------------------------------------------- + * General functions + */ + +int +ipset_init_library(void); + + +/*--------------------------------------------------------------------- + * IP set functions + */ + +void +ipset_init(struct ip_set *set); + +void +ipset_done(struct ip_set *set); + +struct ip_set * +ipset_new(void); + +void +ipset_free(struct ip_set *set); + +bool +ipset_is_empty(const struct ip_set *set); + +bool +ipset_is_equal(const struct ip_set *set1, const struct ip_set *set2); + +size_t +ipset_memory_size(const struct ip_set *set); + +int +ipset_save(FILE *stream, const struct ip_set *set); + +int +ipset_save_to_stream(struct cork_stream_consumer *stream, + const struct ip_set *set); + +int +ipset_save_dot(FILE *stream, const struct ip_set *set); + +struct ip_set * +ipset_load(FILE *stream); + +bool +ipset_ipv4_add(struct ip_set *set, struct cork_ipv4 *elem); + +bool +ipset_ipv4_add_network(struct ip_set *set, struct cork_ipv4 *elem, + unsigned int cidr_prefix); + +bool +ipset_ipv4_remove(struct ip_set *set, struct cork_ipv4 *elem); + +bool +ipset_ipv4_remove_network(struct ip_set *set, struct cork_ipv4 *elem, + unsigned int cidr_prefix); + +bool +ipset_contains_ipv4(const struct ip_set *set, struct cork_ipv4 *elem); + +bool +ipset_ipv6_add(struct ip_set *set, struct cork_ipv6 *elem); + +bool +ipset_ipv6_add_network(struct ip_set *set, struct cork_ipv6 *elem, + unsigned int cidr_prefix); + +bool +ipset_ipv6_remove(struct ip_set *set, struct cork_ipv6 *elem); + +bool +ipset_ipv6_remove_network(struct ip_set *set, struct cork_ipv6 *elem, + unsigned int cidr_prefix); + +bool +ipset_contains_ipv6(const struct ip_set *set, struct cork_ipv6 *elem); + +bool +ipset_ip_add(struct ip_set *set, struct cork_ip *addr); + +bool +ipset_ip_add_network(struct ip_set *set, struct cork_ip *addr, + unsigned int cidr_prefix); + +bool +ipset_ip_remove(struct ip_set *set, struct cork_ip *addr); + +bool +ipset_ip_remove_network(struct ip_set *set, struct cork_ip *addr, + unsigned int cidr_prefix); + +bool +ipset_contains_ip(const struct ip_set *set, struct cork_ip *elem); + + +/* An internal state type used by the ipset_iterator_multiple_expansion_state + * field. */ +enum ipset_iterator_state { + IPSET_ITERATOR_NORMAL = 0, + IPSET_ITERATOR_MULTIPLE_IPV4, + IPSET_ITERATOR_MULTIPLE_IPV6 +}; + + +/* An iterator that returns all of the IP addresses that have a given value in + * an IP set or map. */ +struct ipset_iterator { + /* The address of the current IP network in the iterator. */ + struct cork_ip addr; + + /* The netmask of the current IP network in the iterator, given as a + * CIDR prefix. For a single IP address, this will be 32 or 128. */ + unsigned int cidr_prefix; + + /* Whether the current assignment needs to be expanded a second + * time. + * + * We have to expand IPv4 and IPv6 assignments separately, since the + * set of variables to turn into address bits is different. + * Unfortunately, a BDD assignment can contain both IPv4 and IPv6 + * addresses, if variable 0 is EITHER. (This is trivially true for + * the empty set, for instance.) In this case, we have to + * explicitly set variable 0 to TRUE, expand it as IPv4, and then + * set it to FALSE, and expand it as IPv6. This variable tells us + * whether we're in an assignment that needs to be expanded twice, + * and if so, which expansion we're currently in. + */ + enum ipset_iterator_state multiple_expansion_state; + + /* An iterator for retrieving each assignment in the set's BDD. */ + struct ipset_bdd_iterator *bdd_iterator; + + /* An iterator for expanding each assignment into individual IP + * addresses. */ + struct ipset_expanded_assignment *assignment_iterator; + + /* Whether there are any more IP addresses in this iterator. */ + bool finished; + + /* The desired value for each IP address. */ + bool desired_value; + + /* Whether to summarize the contents of the IP set as networks, + * where possible. */ + bool summarize; +}; + + +struct ipset_iterator * +ipset_iterate(struct ip_set *set, bool desired_value); + +struct ipset_iterator * +ipset_iterate_networks(struct ip_set *set, bool desired_value); + +void +ipset_iterator_free(struct ipset_iterator *iterator); + +void +ipset_iterator_advance(struct ipset_iterator *iterator); + + +/*--------------------------------------------------------------------- + * IP map functions + */ + +void +ipmap_init(struct ip_map *map, int default_value); + +void +ipmap_done(struct ip_map *map); + +struct ip_map * +ipmap_new(int default_value); + +void +ipmap_free(struct ip_map *map); + +bool +ipmap_is_empty(const struct ip_map *map); + +bool +ipmap_is_equal(const struct ip_map *map1, const struct ip_map *map2); + +size_t +ipmap_memory_size(const struct ip_map *map); + +int +ipmap_save(FILE *stream, const struct ip_map *map); + +int +ipmap_save_to_stream(struct cork_stream_consumer *stream, + const struct ip_map *map); + +struct ip_map * +ipmap_load(FILE *stream); + +void +ipmap_ipv4_set(struct ip_map *map, struct cork_ipv4 *elem, int value); + +void +ipmap_ipv4_set_network(struct ip_map *map, struct cork_ipv4 *elem, + unsigned int cidr_prefix, int value); + +int +ipmap_ipv4_get(struct ip_map *map, struct cork_ipv4 *elem); + +void +ipmap_ipv6_set(struct ip_map *map, struct cork_ipv6 *elem, int value); + +void +ipmap_ipv6_set_network(struct ip_map *map, struct cork_ipv6 *elem, + unsigned int cidr_prefix, int value); + +int +ipmap_ipv6_get(struct ip_map *map, struct cork_ipv6 *elem); + +void +ipmap_ip_set(struct ip_map *map, struct cork_ip *addr, int value); + +void +ipmap_ip_set_network(struct ip_map *map, struct cork_ip *addr, + unsigned int cidr_prefix, int value); + +int +ipmap_ip_get(struct ip_map *map, struct cork_ip *addr); + + +#endif /* IPSET_IPSET_H */ diff --git a/libipset/include/ipset/logging.h b/libipset/include/ipset/logging.h new file mode 100644 index 00000000..c4fb0d6e --- /dev/null +++ b/libipset/include/ipset/logging.h @@ -0,0 +1,31 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#ifndef IPSET_LOGGING_H +#define IPSET_LOGGING_H + + +#if !defined(IPSET_DEBUG) +#define IPSET_DEBUG 0 +#endif + +#if IPSET_DEBUG +#include +#define DEBUG(...) \ + do { \ + fprintf(stderr, __VA_ARGS__); \ + fprintf(stderr, "\n"); \ + } while (0) +#else +#define DEBUG(...) /* no debug messages */ +#endif + + +#endif /* IPSET_LOGGING_H */ diff --git a/libipset/map/.dirstamp b/libipset/map/.dirstamp new file mode 100644 index 00000000..e69de29b diff --git a/libipset/map/Makefile.am b/libipset/map/Makefile.am new file mode 100644 index 00000000..b037b316 --- /dev/null +++ b/libipset/map/Makefile.am @@ -0,0 +1,30 @@ +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + +noinst_LTLIBRARIES = libipset.la + +bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ + bdd/reachable.c bdd/read.c bdd/write.c +map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ + map/storage.c +set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ + set/iterator.c set/storage.c + +libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} + +libipset_la_LDFLAGS = -static diff --git a/libipset/map/allocation.c b/libipset/map/allocation.c new file mode 100644 index 00000000..0dee17b6 --- /dev/null +++ b/libipset/map/allocation.c @@ -0,0 +1,50 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/ipset.h" + + +void +ipmap_init(struct ip_map *map, int default_value) +{ + /* The map starts empty, so every value assignment should yield the + * default. */ + map->cache = ipset_node_cache_new(); + map->default_bdd = ipset_terminal_node_id(default_value); + map->map_bdd = map->default_bdd; +} + + +struct ip_map * +ipmap_new(int default_value) +{ + struct ip_map *result = cork_new(struct ip_map); + ipmap_init(result, default_value); + return result; +} + + +void +ipmap_done(struct ip_map *map) +{ + ipset_node_decref(map->cache, map->map_bdd); + ipset_node_cache_free(map->cache); +} + + +void +ipmap_free(struct ip_map *map) +{ + ipmap_done(map); + free(map); +} diff --git a/libipset/map/inspection-template.c.in b/libipset/map/inspection-template.c.in new file mode 100644 index 00000000..e6447d5e --- /dev/null +++ b/libipset/map/inspection-template.c.in @@ -0,0 +1,88 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/bits.h" +#include "ipset/errors.h" +#include "ipset/ipset.h" + + +/** + * Given a BDD variable number, return the index of the corresponding + * bit in an IP address. IPv4 addresses use variables 1-32; IPv6 + * addresses use 1-128. (Variable 0 is used to identify the kind of + * address — TRUE for IPv4, FALSE for IPv6.) + */ + +static unsigned int +IPMAP_NAME(bit_for_var)(ipset_variable var) +{ + return (var - 1); +} + + +/** + * An assignment function that can be used to evaluate an IP map BDD. + */ + +static bool +IPMAP_NAME(assignment)(const void *addr, ipset_variable var) +{ + if (var == 0) { + return IP_DISCRIMINATOR_VALUE; + } else { + unsigned int bit = IPMAP_NAME(bit_for_var)(var); + return IPSET_BIT_GET(addr, bit); + } +} + + +int +IPMAP_NAME(get)(struct ip_map *map, CORK_IP *elem) +{ + return ipset_node_evaluate + (map->cache, map->map_bdd, IPMAP_NAME(assignment), elem); +} + + +void +IPMAP_NAME(set_network)(struct ip_map *map, CORK_IP *elem, + unsigned int cidr_prefix, int value) +{ + /* Special case — the BDD for a netmask that's out of range never + * evaluates to true. */ + if (cidr_prefix > IP_BIT_SIZE) { + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "CIDR block %u out of range [0..%u]", cidr_prefix, IP_BIT_SIZE); + return; + } + + ipset_node_id new_bdd = + ipset_node_insert + (map->cache, map->map_bdd, + IPMAP_NAME(assignment), elem, cidr_prefix + 1, value); + ipset_node_decref(map->cache, map->map_bdd); + map->map_bdd = new_bdd; +} + + +void +IPMAP_NAME(set)(struct ip_map *map, CORK_IP *elem, int value) +{ + ipset_node_id new_bdd = + ipset_node_insert + (map->cache, map->map_bdd, + IPMAP_NAME(assignment), elem, IP_BIT_SIZE + 1, value); + ipset_node_decref(map->cache, map->map_bdd); + map->map_bdd = new_bdd; +} diff --git a/libipset/map/inspection.c b/libipset/map/inspection.c new file mode 100644 index 00000000..e23253b2 --- /dev/null +++ b/libipset/map/inspection.c @@ -0,0 +1,69 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/ipset.h" + +bool +ipmap_is_empty(const struct ip_map *map) +{ + /* Since BDDs are unique, any map that maps all addresses to the + * default value is “empty”. */ + return (map->map_bdd == map->default_bdd); +} + +bool +ipmap_is_equal(const struct ip_map *map1, const struct ip_map *map2) +{ + return ipset_node_cache_nodes_equal + (map1->cache, map1->map_bdd, map2->cache, map2->map_bdd); +} + +size_t +ipmap_memory_size(const struct ip_map *map) +{ + return ipset_node_memory_size(map->cache, map->map_bdd); +} + + +void +ipmap_ip_set(struct ip_map *map, struct cork_ip *addr, int value) +{ + if (addr->version == 4) { + ipmap_ipv4_set(map, &addr->ip.v4, value); + } else { + ipmap_ipv6_set(map, &addr->ip.v6, value); + } +} + + +void +ipmap_ip_set_network(struct ip_map *map, struct cork_ip *addr, + unsigned int cidr_prefix, int value) +{ + if (addr->version == 4) { + ipmap_ipv4_set_network(map, &addr->ip.v4, cidr_prefix, value); + } else { + ipmap_ipv6_set_network(map, &addr->ip.v6, cidr_prefix, value); + } +} + + +int +ipmap_ip_get(struct ip_map *map, struct cork_ip *addr) +{ + if (addr->version == 4) { + return ipmap_ipv4_get(map, &addr->ip.v4); + } else { + return ipmap_ipv6_get(map, &addr->ip.v6); + } +} diff --git a/libipset/map/ipv4_map.c b/libipset/map/ipv4_map.c new file mode 100644 index 00000000..dcb88773 --- /dev/null +++ b/libipset/map/ipv4_map.c @@ -0,0 +1,37 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +/* + * The IPv4 and IPv6 map types are basically identical, except for the + * names of the functions, and the size of the values that are being + * stored. Rather than having two mostly duplicate definitions of each + * function, we define “template functions” where anything that depends + * on the size of the IP address is defined using the following macros. + */ + + +/* The name of the cork_ipvX type. */ +#define CORK_IP struct cork_ipv4 + +/* The number of bits in an IPvX address. */ +#define IP_BIT_SIZE 32 + +/* The value of the discriminator variable for an IPvX address. */ +#define IP_DISCRIMINATOR_VALUE true + +/* Creates a identifier of the form “ipset_ipv4_”. */ +#define IPSET_NAME(basename) ipset_ipv4_##basename + +/* Creates a identifier of the form “ipmap_ipv4_”. */ +#define IPMAP_NAME(basename) ipmap_ipv4_##basename + + +/* Now include all of the templates. */ +#include "inspection-template.c.in" diff --git a/libipset/map/ipv6_map.c b/libipset/map/ipv6_map.c new file mode 100644 index 00000000..5821141b --- /dev/null +++ b/libipset/map/ipv6_map.c @@ -0,0 +1,37 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +/* + * The IPv4 and IPv6 map types are basically identical, except for the + * names of the functions, and the size of the values that are being + * stored. Rather than having two mostly duplicate definitions of each + * function, we define “template functions” where anything that depends + * on the size of the IP address is defined using the following macros. + */ + + +/* The name of the cork_ipvX type. */ +#define CORK_IP struct cork_ipv6 + +/* The number of bits in an IPvX address. */ +#define IP_BIT_SIZE 128 + +/* The value of the discriminator variable for an IPvX address. */ +#define IP_DISCRIMINATOR_VALUE false + +/* Creates a identifier of the form “ipset_ipv6_”. */ +#define IPSET_NAME(basename) ipset_ipv6_##basename + +/* Creates a identifier of the form “ipmap_ipv6_”. */ +#define IPMAP_NAME(basename) ipmap_ipv6_##basename + + +/* Now include all of the templates. */ +#include "inspection-template.c.in" diff --git a/libipset/map/storage.c b/libipset/map/storage.c new file mode 100644 index 00000000..79de2331 --- /dev/null +++ b/libipset/map/storage.c @@ -0,0 +1,101 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include +#include + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/errors.h" +#include "ipset/ipset.h" + + +static void +create_errno_error(FILE *stream) +{ + if (ferror(stream)) { + cork_error_set(IPSET_ERROR, IPSET_IO_ERROR, "%s", strerror(errno)); + } else { + cork_unknown_error(); + } +} + +struct file_consumer { + /* file_consumer is a subclass of cork_stream_consumer */ + struct cork_stream_consumer parent; + /* the file to write the data into */ + FILE *fp; +}; + +static int +file_consumer_data(struct cork_stream_consumer *vself, + const void *buf, size_t size, bool is_first) +{ + struct file_consumer *self = + cork_container_of(vself, struct file_consumer, parent); + size_t bytes_written = fwrite(buf, 1, size, self->fp); + /* If there was an error writing to the file, then signal this to + * the producer */ + if (bytes_written == size) { + return 0; + } else { + create_errno_error(self->fp); + return -1; + } +} + +static int +file_consumer_eof(struct cork_stream_consumer *vself) +{ + /* We don't close the file, so there's nothing special to do at + * end-of-stream. */ + return 0; +} + + +int +ipmap_save_to_stream(struct cork_stream_consumer *stream, + const struct ip_map *map) +{ + return ipset_node_cache_save(stream, map->cache, map->map_bdd); +} + +int +ipmap_save(FILE *fp, const struct ip_map *map) +{ + struct file_consumer stream = { + { file_consumer_data, file_consumer_eof, NULL }, fp + }; + return ipmap_save_to_stream(&stream.parent, map); +} + + +struct ip_map * +ipmap_load(FILE *stream) +{ + struct ip_map *map; + ipset_node_id new_bdd; + + /* It doesn't matter what default value we use here, because we're + * going to replace it with the default BDD we load in from the + * file. */ + map = ipmap_new(0); + new_bdd = ipset_node_cache_load(stream, map->cache); + if (cork_error_occurred()) { + ipmap_free(map); + return NULL; + } + + map->map_bdd = new_bdd; + return map; +} diff --git a/libipset/set/.dirstamp b/libipset/set/.dirstamp new file mode 100644 index 00000000..e69de29b diff --git a/libipset/set/Makefile.am b/libipset/set/Makefile.am new file mode 100644 index 00000000..b037b316 --- /dev/null +++ b/libipset/set/Makefile.am @@ -0,0 +1,30 @@ +# This file is part of libasyncns. +# +# Copyright 2005-2008 Lennart Poettering +# +# libasyncns is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation, either version 2.1 of the +# License, or (at your option) any later version. +# +# libasyncns is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with libasyncns. If not, see +# . + +noinst_LTLIBRARIES = libipset.la + +bdd_src = bdd/assignments.c bdd/basics.c bdd/bdd-iterator.c bdd/expanded.c \ + bdd/reachable.c bdd/read.c bdd/write.c +map_src = map/allocation.c map/inspection.c map/ipv4_map.c map/ipv6_map.c \ + map/storage.c +set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \ + set/iterator.c set/storage.c + +libipset_la_SOURCES = ${bdd_src} ${map_src} ${set_src} + +libipset_la_LDFLAGS = -static diff --git a/libipset/set/allocation.c b/libipset/set/allocation.c new file mode 100644 index 00000000..a1e93920 --- /dev/null +++ b/libipset/set/allocation.c @@ -0,0 +1,49 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/ipset.h" + + +void +ipset_init(struct ip_set *set) +{ + /* The set starts empty, so every value assignment should yield + * false. */ + set->cache = ipset_node_cache_new(); + set->set_bdd = ipset_terminal_node_id(false); +} + + +struct ip_set * +ipset_new(void) +{ + struct ip_set *result = cork_new(struct ip_set); + ipset_init(result); + return result; +} + + +void +ipset_done(struct ip_set *set) +{ + ipset_node_decref(set->cache, set->set_bdd); + ipset_node_cache_free(set->cache); +} + + +void +ipset_free(struct ip_set *set) +{ + ipset_done(set); + free(set); +} diff --git a/libipset/set/inspection-template.c.in b/libipset/set/inspection-template.c.in new file mode 100644 index 00000000..6e0142c0 --- /dev/null +++ b/libipset/set/inspection-template.c.in @@ -0,0 +1,130 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/bits.h" +#include "ipset/errors.h" +#include "ipset/ipset.h" + + +/** + * Given a BDD variable number, return the index of the corresponding + * bit in an IP address. IPv4 addresses use variables 1-32; IPv6 + * addresses use 1-128. (Variable 0 is used to identify the kind of + * address — TRUE for IPv4, FALSE for IPv6.) + */ + +static unsigned int +IPSET_NAME(bit_for_var)(ipset_variable var) +{ + return (var - 1); +} + + +/** + * An assignment function that can be used to evaluate an IP set BDD. + */ + +static bool +IPSET_NAME(assignment)(const void *addr, ipset_variable var) +{ + if (var == 0) { + return IP_DISCRIMINATOR_VALUE; + } else { + unsigned int bit = IPSET_NAME(bit_for_var)(var); + return IPSET_BIT_GET(addr, bit); + } +} + + +bool +IPSET_PRENAME(contains)(const struct ip_set *set, CORK_IP *elem) +{ + return ipset_node_evaluate + (set->cache, set->set_bdd, IPSET_NAME(assignment), elem); +} + + +bool +IPSET_NAME(add_network)(struct ip_set *set, CORK_IP *elem, + unsigned int cidr_prefix) +{ + /* Special case — the BDD for a netmask that's out of range never + * evaluates to true. */ + if (cidr_prefix > IP_BIT_SIZE) { + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "CIDR block %u out of range [0..%u]", cidr_prefix, IP_BIT_SIZE); + return false; + } + + ipset_node_id new_bdd = + ipset_node_insert + (set->cache, set->set_bdd, + IPSET_NAME(assignment), elem, cidr_prefix + 1, 1); + bool result = (new_bdd == set->set_bdd); + ipset_node_decref(set->cache, set->set_bdd); + set->set_bdd = new_bdd; + return result; +} + + +bool +IPSET_NAME(add)(struct ip_set *set, CORK_IP *elem) +{ + ipset_node_id new_bdd = + ipset_node_insert + (set->cache, set->set_bdd, + IPSET_NAME(assignment), elem, IP_BIT_SIZE + 1, 1); + bool result = (new_bdd == set->set_bdd); + ipset_node_decref(set->cache, set->set_bdd); + set->set_bdd = new_bdd; + return result; +} + + +bool +IPSET_NAME(remove)(struct ip_set *set, CORK_IP *elem) +{ + ipset_node_id new_bdd = + ipset_node_insert + (set->cache, set->set_bdd, + IPSET_NAME(assignment), elem, IP_BIT_SIZE + 1, 0); + bool result = (new_bdd == set->set_bdd); + ipset_node_decref(set->cache, set->set_bdd); + set->set_bdd = new_bdd; + return result; +} + + +bool +IPSET_NAME(remove_network)(struct ip_set *set, CORK_IP *elem, + unsigned int cidr_prefix) +{ + /* Special case — the BDD for a netmask that's out of range never + * evaluates to true. */ + if (cidr_prefix > IP_BIT_SIZE) { + cork_error_set + (IPSET_ERROR, IPSET_PARSE_ERROR, + "CIDR block %u out of range [0..%u]", cidr_prefix, IP_BIT_SIZE); + return false; + } + + ipset_node_id new_bdd = + ipset_node_insert + (set->cache, set->set_bdd, + IPSET_NAME(assignment), elem, cidr_prefix + 1, 0); + bool result = (new_bdd == set->set_bdd); + ipset_node_decref(set->cache, set->set_bdd); + set->set_bdd = new_bdd; + return result; +} diff --git a/libipset/set/inspection.c b/libipset/set/inspection.c new file mode 100644 index 00000000..2cb17ba8 --- /dev/null +++ b/libipset/set/inspection.c @@ -0,0 +1,91 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/ipset.h" + +bool +ipset_is_empty(const struct ip_set *set) +{ + /* Since BDDs are unique, the only empty set is the “false” BDD. */ + return (set->set_bdd == ipset_terminal_node_id(false)); +} + +bool +ipset_is_equal(const struct ip_set *set1, const struct ip_set *set2) +{ + return ipset_node_cache_nodes_equal + (set1->cache, set1->set_bdd, set2->cache, set2->set_bdd); +} + +size_t +ipset_memory_size(const struct ip_set *set) +{ + return ipset_node_memory_size(set->cache, set->set_bdd); +} + + +bool +ipset_ip_add(struct ip_set *set, struct cork_ip *addr) +{ + if (addr->version == 4) { + return ipset_ipv4_add(set, &addr->ip.v4); + } else { + return ipset_ipv6_add(set, &addr->ip.v6); + } +} + + +bool +ipset_ip_add_network(struct ip_set *set, struct cork_ip *addr, + unsigned int cidr_prefix) +{ + if (addr->version == 4) { + return ipset_ipv4_add_network(set, &addr->ip.v4, cidr_prefix); + } else { + return ipset_ipv6_add_network(set, &addr->ip.v6, cidr_prefix); + } +} + + +bool +ipset_ip_remove(struct ip_set *set, struct cork_ip *addr) +{ + if (addr->version == 4) { + return ipset_ipv4_remove(set, &addr->ip.v4); + } else { + return ipset_ipv6_remove(set, &addr->ip.v6); + } +} + + +bool +ipset_ip_remove_network(struct ip_set *set, struct cork_ip *addr, + unsigned int cidr_prefix) +{ + if (addr->version == 4) { + return ipset_ipv4_remove_network(set, &addr->ip.v4, cidr_prefix); + } else { + return ipset_ipv6_remove_network(set, &addr->ip.v6, cidr_prefix); + } +} + + +bool +ipset_contains_ip(const struct ip_set *set, struct cork_ip *addr) +{ + if (addr->version == 4) { + return ipset_contains_ipv4(set, &addr->ip.v4); + } else { + return ipset_contains_ipv6(set, &addr->ip.v6); + } +} diff --git a/libipset/set/ipv4_set.c b/libipset/set/ipv4_set.c new file mode 100644 index 00000000..2a33a671 --- /dev/null +++ b/libipset/set/ipv4_set.c @@ -0,0 +1,37 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +/* + * The IPv4 and IPv6 set types are basically identical, except for the + * names of the functions, and the size of the values that are being + * stored. Rather than having two mostly duplicate definitions of each + * function, we define “template functions” where anything that depends + * on the size of the IP address is defined using the following macros. + */ + + +/* The name of the cork_ipvX type. */ +#define CORK_IP struct cork_ipv4 + +/* The number of bits in an IPvX address. */ +#define IP_BIT_SIZE 32 + +/* The value of the discriminator variable for an IPvX address. */ +#define IP_DISCRIMINATOR_VALUE true + +/* Creates a identifier of the form “ipset_ipv4_”. */ +#define IPSET_NAME(basename) ipset_ipv4_##basename + +/* Creates a identifier of the form “ipset__ipv4”. */ +#define IPSET_PRENAME(basename) ipset_##basename##_ipv4 + + +/* Now include all of the templates. */ +#include "inspection-template.c.in" diff --git a/libipset/set/ipv6_set.c b/libipset/set/ipv6_set.c new file mode 100644 index 00000000..fac72cc5 --- /dev/null +++ b/libipset/set/ipv6_set.c @@ -0,0 +1,38 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2009-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +/* + * The IPv4 and IPv6 set types are basically identical, except for the + * names of the functions, and the size of the values that are being + * stored. Rather than having two mostly duplicate definitions of + * each function, we define “template functions” where anything that + * depends on the size of the IP address is defined using the + * following macros. + */ + + +/* The name of the cork_ipvX type. */ +#define CORK_IP struct cork_ipv6 + +/* The number of bits in an IPvX address. */ +#define IP_BIT_SIZE 128 + +/* The value of the discriminator variable for an IPvX address. */ +#define IP_DISCRIMINATOR_VALUE false + +/* Creates a identifier of the form “ipset_ipv6_”. */ +#define IPSET_NAME(basename) ipset_ipv6_##basename + +/* Creates a identifier of the form “ipset__ipv6”. */ +#define IPSET_PRENAME(basename) ipset_##basename##_ipv6 + + +/* Now include all of the templates. */ +#include "inspection-template.c.in" diff --git a/libipset/set/iterator.c b/libipset/set/iterator.c new file mode 100644 index 00000000..e601caa7 --- /dev/null +++ b/libipset/set/iterator.c @@ -0,0 +1,342 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/bits.h" +#include "ipset/ipset.h" +#include "ipset/logging.h" + + +#define IPV4_BIT_SIZE 32 +#define IPV6_BIT_SIZE 128 + + +/* Forward declarations */ + +static void +process_assignment(struct ipset_iterator *iterator); + +static void +expand_ipv6(struct ipset_iterator *iterator); + + +/** + * Find the highest non-EITHER bit in an assignment, starting from the + * given bit index. + */ +static unsigned int +find_last_non_either_bit(struct ipset_assignment *assignment, + unsigned int starting_bit) +{ + unsigned int i; + + for (i = starting_bit; i >= 1; i--) { + enum ipset_tribool value = ipset_assignment_get(assignment, i); + if (value != IPSET_EITHER) { + return i; + } + } + + return 0; +} + + +/** + * Create a generic IP address object from the current expanded + * assignment. + */ +static void +create_ip_address(struct ipset_iterator *iterator) +{ + struct cork_ip *addr = &iterator->addr; + struct ipset_expanded_assignment *exp = iterator->assignment_iterator; + + /* Initialize the address to all 0 bits. */ + memset(addr, 0, sizeof(struct cork_ip)); + + /* Check variable 0 to see if this is an IPv4 or IPv6 address. */ + addr->version = IPSET_BIT_GET(exp->values.buf, 0)? 4: 6; + + /* Copy bits from the expanded assignment. The number of bits to + * copy is given as the current netmask. We'll have calculated that + * already based on the non-expanded assignment. */ + unsigned int i; + for (i = 0; i < iterator->cidr_prefix; i++) { + IPSET_BIT_SET(&addr->ip, i, IPSET_BIT_GET(exp->values.buf, i+1)); + } + +#if IPSET_DEBUG + char buf[CORK_IP_STRING_LENGTH]; + cork_ip_to_raw_string(addr, buf); + DEBUG("Current IP address is %s/%u", buf, iterator->cidr_prefix); +#endif +} + + +/** + * Advance the BDD iterator, taking into account that some assignments + * need to be expanded twice. + */ +static void +advance_assignment(struct ipset_iterator *iterator) +{ + /* Check the current state of the iterator to determine how to + * advance. */ + + /* In most cases, the assignment we just finished only needed to be + * expanded once. So we move on to the next assignment and process + * it. */ + if (CORK_LIKELY(iterator->multiple_expansion_state == + IPSET_ITERATOR_NORMAL)) + { + ipset_bdd_iterator_advance(iterator->bdd_iterator); + process_assignment(iterator); + return; + } + + /* If the assignment needs to be expanded twice, we'll do the IPv4 + * expansion first. If that's what we've just finished, do the IPv6 + * expansion next. */ + + if (iterator->multiple_expansion_state == IPSET_ITERATOR_MULTIPLE_IPV4) { + DEBUG("Expanding IPv6 second"); + + iterator->multiple_expansion_state = IPSET_ITERATOR_MULTIPLE_IPV6; + ipset_assignment_set + (iterator->bdd_iterator->assignment, 0, IPSET_FALSE); + expand_ipv6(iterator); + return; + } + + /* If we've just finished the IPv6 expansion, then we've finished + * with this assignment. Before moving on to the next one, we have + * to reset variable 0 to EITHER (which it was before we started + * this whole mess). */ + + if (iterator->multiple_expansion_state == IPSET_ITERATOR_MULTIPLE_IPV6) { + DEBUG("Finished both expansions"); + + ipset_assignment_set + (iterator->bdd_iterator->assignment, 0, IPSET_EITHER); + ipset_bdd_iterator_advance(iterator->bdd_iterator); + process_assignment(iterator); + return; + } +} + + +/** + * Process the current expanded assignment in the current BDD + * assignment. + */ +static void +process_expanded_assignment(struct ipset_iterator *iterator) +{ + if (iterator->assignment_iterator->finished) { + /* If there isn't anything in the expanded assignment, advance + * to the next BDD assignment. */ + + DEBUG("Expanded assignment is finished"); + ipset_expanded_assignment_free(iterator->assignment_iterator); + iterator->assignment_iterator = NULL; + advance_assignment(iterator); + } else { + /* Otherwise, we've found a fully expanded assignment, so create + * an IP address for it and return. */ + create_ip_address(iterator); + } +} + + +/** + * Expand the current assignment as IPv4 addresses. + */ +static void +expand_ipv4(struct ipset_iterator *iterator) +{ + unsigned int last_bit; + + if (iterator->summarize) { + last_bit = find_last_non_either_bit + (iterator->bdd_iterator->assignment, IPV4_BIT_SIZE); + DEBUG("Last non-either bit is %u", last_bit); + } else { + last_bit = IPV4_BIT_SIZE; + } + + iterator->assignment_iterator = + ipset_assignment_expand + (iterator->bdd_iterator->assignment, last_bit + 1); + iterator->cidr_prefix = last_bit; + + process_expanded_assignment(iterator); +} + + +/** + * Expand the current assignment as IPv4 addresses. + */ +static void +expand_ipv6(struct ipset_iterator *iterator) +{ + unsigned int last_bit; + + if (iterator->summarize) { + last_bit = find_last_non_either_bit + (iterator->bdd_iterator->assignment, IPV6_BIT_SIZE); + DEBUG("Last non-either bit is %u", last_bit); + } else { + last_bit = IPV6_BIT_SIZE; + } + + iterator->assignment_iterator = + ipset_assignment_expand + (iterator->bdd_iterator->assignment, last_bit + 1); + iterator->cidr_prefix = last_bit; + + process_expanded_assignment(iterator); +} + + +/** + * Process the current assignment in the BDD iterator. + */ + +static void +process_assignment(struct ipset_iterator *iterator) +{ + while (!iterator->bdd_iterator->finished) { + if (iterator->bdd_iterator->value == iterator->desired_value) { + /* If the BDD iterator hasn't finished, and the result of + * the function with this assignment matches what the caller + * wants, then we've found an assignment to generate IP + * addresses from. + * + * Try to expand this assignment, and process the first + * expanded assignment. We want 32 + 1 variables if the + * current address is IPv4; 128 + 1 if it's IPv6. */ + + DEBUG("Got a matching BDD assignment"); + enum ipset_tribool address_type = ipset_assignment_get + (iterator->bdd_iterator->assignment, 0); + + if (address_type == IPSET_FALSE) { + /* FALSE means IPv6*/ + DEBUG("Assignment is IPv6"); + iterator->multiple_expansion_state = IPSET_ITERATOR_NORMAL; + expand_ipv6(iterator); + return; + } else if (address_type == IPSET_TRUE) { + /* TRUE means IPv4*/ + DEBUG("Assignment is IPv4"); + iterator->multiple_expansion_state = IPSET_ITERATOR_NORMAL; + expand_ipv4(iterator); + return; + } else { + /* EITHER means that this assignment contains both IPv4 + * and IPv6 addresses. Expand it as IPv4 first. */ + DEBUG("Assignment is both IPv4 and IPv6"); + DEBUG("Expanding IPv4 first"); + iterator->multiple_expansion_state = + IPSET_ITERATOR_MULTIPLE_IPV4; + ipset_assignment_set + (iterator->bdd_iterator->assignment, 0, IPSET_TRUE); + expand_ipv4(iterator); + return; + } + } + + /* The BDD iterator has a value, but it doesn't match the one we + * want. Advance the BDD iterator and try again. */ + DEBUG("Value is %d, skipping", iterator->bdd_iterator->value); + ipset_bdd_iterator_advance(iterator->bdd_iterator); + } + + /* If we fall through, then the BDD iterator has finished. That + * means there's nothing left for the set iterator. */ + + DEBUG("Set iterator is finished"); + ipset_expanded_assignment_free(iterator->assignment_iterator); + iterator->assignment_iterator = NULL; + + ipset_bdd_iterator_free(iterator->bdd_iterator); + iterator->bdd_iterator = NULL; + iterator->finished = true; +} + + +static struct ipset_iterator * +create_iterator(struct ip_set *set, bool desired_value, bool summarize) +{ + /* First allocate the iterator itself. */ + struct ipset_iterator *iterator = cork_new(struct ipset_iterator); + iterator->finished = false; + iterator->assignment_iterator = NULL; + iterator->desired_value = desired_value; + iterator->summarize = summarize; + + /* Then create the iterator that returns each BDD assignment. */ + DEBUG("Iterating set"); + iterator->bdd_iterator = ipset_node_iterate(set->cache, set->set_bdd); + + /* Then drill down from the current BDD assignment, creating an + * expanded assignment for it. */ + process_assignment(iterator); + return iterator; +} + + +struct ipset_iterator * +ipset_iterate(struct ip_set *set, bool desired_value) +{ + return create_iterator(set, desired_value, false); +} + + +struct ipset_iterator * +ipset_iterate_networks(struct ip_set *set, bool desired_value) +{ + return create_iterator(set, desired_value, true); +} + + +void +ipset_iterator_free(struct ipset_iterator *iterator) +{ + if (iterator->bdd_iterator != NULL) { + ipset_bdd_iterator_free(iterator->bdd_iterator); + } + if (iterator->assignment_iterator != NULL) { + ipset_expanded_assignment_free(iterator->assignment_iterator); + } + free(iterator); +} + + +void +ipset_iterator_advance(struct ipset_iterator *iterator) +{ + /* If we're already at the end of the iterator, don't do anything. */ + + if (CORK_UNLIKELY(iterator->finished)) { + return; + } + + /* Otherwise, advance the expanded assignment iterator to the next + * assignment, and then drill down into it. */ + + DEBUG("Advancing set iterator"); + ipset_expanded_assignment_advance(iterator->assignment_iterator); + process_expanded_assignment(iterator); +} diff --git a/libipset/set/storage.c b/libipset/set/storage.c new file mode 100644 index 00000000..7dc09275 --- /dev/null +++ b/libipset/set/storage.c @@ -0,0 +1,107 @@ +/* -*- coding: utf-8 -*- + * ---------------------------------------------------------------------- + * Copyright © 2010-2012, RedJack, LLC. + * All rights reserved. + * + * Please see the LICENSE.txt file in this distribution for license + * details. + * ---------------------------------------------------------------------- + */ + +#include +#include +#include +#include + +#include + +#include "ipset/bdd/nodes.h" +#include "ipset/errors.h" +#include "ipset/ipset.h" + + +static void +create_errno_error(FILE *stream) +{ + if (ferror(stream)) { + cork_error_set(IPSET_ERROR, IPSET_IO_ERROR, "%s", strerror(errno)); + } else { + cork_unknown_error(); + } +} + +struct file_consumer { + /* file_consumer is a subclass of cork_stream_consumer */ + struct cork_stream_consumer parent; + /* the file to write the data into */ + FILE *fp; +}; + +static int +file_consumer_data(struct cork_stream_consumer *vself, + const void *buf, size_t size, bool is_first) +{ + struct file_consumer *self = + cork_container_of(vself, struct file_consumer, parent); + size_t bytes_written = fwrite(buf, 1, size, self->fp); + /* If there was an error writing to the file, then signal this to + * the producer */ + if (bytes_written == size) { + return 0; + } else { + create_errno_error(self->fp); + return -1; + } +} + +static int +file_consumer_eof(struct cork_stream_consumer *vself) +{ + /* We don't close the file, so there's nothing special to do at + * end-of-stream. */ + return 0; +} + +int +ipset_save_to_stream(struct cork_stream_consumer *stream, + const struct ip_set *set) +{ + return ipset_node_cache_save(stream, set->cache, set->set_bdd); +} + +int +ipset_save(FILE *fp, const struct ip_set *set) +{ + struct file_consumer stream = { + { file_consumer_data, file_consumer_eof, NULL }, fp + }; + return ipset_save_to_stream(&stream.parent, set); +} + + +int +ipset_save_dot(FILE *fp, const struct ip_set *set) +{ + struct file_consumer stream = { + { file_consumer_data, file_consumer_eof, NULL }, fp + }; + return ipset_node_cache_save_dot(&stream.parent, set->cache, set->set_bdd); +} + + +struct ip_set * +ipset_load(FILE *stream) +{ + struct ip_set *set; + ipset_node_id new_bdd; + + set = ipset_new(); + new_bdd = ipset_node_cache_load(stream, set->cache); + if (cork_error_occurred()) { + ipset_free(set); + return NULL; + } + + set->set_bdd = new_bdd; + return set; +} diff --git a/ltmain.sh b/ltmain.sh index 33f642a0..63ae69dc 100644 --- a/ltmain.sh +++ b/ltmain.sh @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 +# $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.1" +VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 @@ -6124,10 +6124,7 @@ func_mode_link () case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then @@ -6447,19 +6444,19 @@ func_mode_link () # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done continue fi # $pass = conv @@ -7352,9 +7349,6 @@ func_mode_link () revision="$number_minor" lt_irix_increment=no ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; esac ;; no) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index 534d1ccd..44e0ecff 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -2512,6 +2512,17 @@ freebsd* | dragonfly*) esac ;; +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2628,7 +2639,7 @@ linux*oldld* | linux*aout* | linux*coff*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -2673,18 +2684,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) dynamic_linker='GNU/Linux ld.so' ;; -netbsdelf*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='NetBSD ld.elf_so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no @@ -3244,6 +3243,10 @@ freebsd* | dragonfly*) fi ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3282,11 +3285,11 @@ irix5* | irix6* | nonstopux*) ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) +linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; -netbsd* | netbsdelf*-gnu) +netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else @@ -4034,7 +4037,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4098,7 +4101,7 @@ m4_if([$1], [CXX], [ ;; esac ;; - netbsd* | netbsdelf*-gnu) + netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise @@ -4333,7 +4336,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -4575,9 +4578,6 @@ m4_if([$1], [CXX], [ ;; esac ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4640,9 +4640,6 @@ dnl Note also adjust exclude_expsyms for C++ above. openbsd*) with_gnu_ld=no ;; - linux* | k*bsd*-gnu | gnu*) - _LT_TAGVAR(link_all_deplibs, $1)=no - ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes @@ -4864,7 +4861,7 @@ _LT_EOF fi ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= @@ -5041,7 +5038,6 @@ _LT_EOF if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi - _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then @@ -5346,7 +5342,7 @@ _LT_EOF _LT_TAGVAR(link_all_deplibs, $1)=yes ;; - netbsd* | netbsdelf*-gnu) + netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else @@ -6226,6 +6222,9 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(ld_shlibs, $1)=yes ;; + gnu*) + ;; + haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6387,7 +6386,7 @@ if test "$_lt_caught_CXX_error" != yes; then _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler diff --git a/missing b/missing index 86a8fc31..db98974f 100755 --- a/missing +++ b/missing @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.13; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,68 +25,40 @@ scriptversion=2012-01-06.13; # UTC # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,228 +70,141 @@ Send bug reports to ." ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` +# Run the given program, remember its exit status. +"$@"; st=$? -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/src/Makefile.in b/src/Makefile.in index d0d68970..c169302e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,23 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ - test $$am__dry = yes; \ - } + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -58,7 +85,8 @@ bin_PROGRAMS = ss-local$(EXEEXT) ss-tunnel$(EXEEXT) $(am__EXEEXT_1) \ @BUILD_WINCOMPAT_TRUE@am__append_3 = win32.c @BUILD_REDIRECTOR_TRUE@am__append_4 = ss-redir subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ $(top_srcdir)/m4/inet_ntop.m4 $(top_srcdir)/m4/libtool.m4 \ @@ -89,9 +117,13 @@ am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = $(top_builddir)/libev/libev.la \ $(am__DEPENDENCIES_1) ss_local_DEPENDENCIES = $(am__DEPENDENCIES_2) -ss_local_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(ss_local_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +ss_local_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(ss_local_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__ss_redir_SOURCES_DIST = utils.c jconf.c json.c encrypt.c redir.c @BUILD_REDIRECTOR_TRUE@am_ss_redir_OBJECTS = utils.$(OBJEXT) \ @BUILD_REDIRECTOR_TRUE@ jconf.$(OBJEXT) json.$(OBJEXT) \ @@ -105,7 +137,7 @@ am_ss_server_OBJECTS = ss_server-utils.$(OBJEXT) \ ss_server_OBJECTS = $(am_ss_server_OBJECTS) ss_server_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/libasyncns/libasyncns.la -ss_server_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +ss_server_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(ss_server_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__ss_tunnel_SOURCES_DIST = utils.c jconf.c json.c encrypt.c \ @@ -118,22 +150,43 @@ am_ss_tunnel_OBJECTS = ss_tunnel-utils.$(OBJEXT) \ $(am__objects_2) ss_tunnel_OBJECTS = $(am_ss_tunnel_OBJECTS) ss_tunnel_DEPENDENCIES = $(am__DEPENDENCIES_2) -ss_tunnel_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +ss_tunnel_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(ss_tunnel_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(ss_local_SOURCES) $(ss_redir_SOURCES) $(ss_server_SOURCES) \ $(ss_tunnel_SOURCES) DIST_SOURCES = $(am__ss_local_SOURCES_DIST) \ @@ -144,11 +197,29 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -339,10 +410,12 @@ install-binPROGRAMS: $(bin_PROGRAMS) fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -363,7 +436,8 @@ uninstall-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -376,18 +450,22 @@ clean-binPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + ss-local$(EXEEXT): $(ss_local_OBJECTS) $(ss_local_DEPENDENCIES) $(EXTRA_ss_local_DEPENDENCIES) @rm -f ss-local$(EXEEXT) - $(ss_local_LINK) $(ss_local_OBJECTS) $(ss_local_LDADD) $(LIBS) + $(AM_V_CCLD)$(ss_local_LINK) $(ss_local_OBJECTS) $(ss_local_LDADD) $(LIBS) + ss-redir$(EXEEXT): $(ss_redir_OBJECTS) $(ss_redir_DEPENDENCIES) $(EXTRA_ss_redir_DEPENDENCIES) @rm -f ss-redir$(EXEEXT) - $(LINK) $(ss_redir_OBJECTS) $(ss_redir_LDADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(ss_redir_OBJECTS) $(ss_redir_LDADD) $(LIBS) + ss-server$(EXEEXT): $(ss_server_OBJECTS) $(ss_server_DEPENDENCIES) $(EXTRA_ss_server_DEPENDENCIES) @rm -f ss-server$(EXEEXT) - $(ss_server_LINK) $(ss_server_OBJECTS) $(ss_server_LDADD) $(LIBS) + $(AM_V_CCLD)$(ss_server_LINK) $(ss_server_OBJECTS) $(ss_server_LDADD) $(LIBS) + ss-tunnel$(EXEEXT): $(ss_tunnel_OBJECTS) $(ss_tunnel_DEPENDENCIES) $(EXTRA_ss_tunnel_DEPENDENCIES) @rm -f ss-tunnel$(EXEEXT) - $(ss_tunnel_LINK) $(ss_tunnel_OBJECTS) $(ss_tunnel_LDADD) $(LIBS) + $(AM_V_CCLD)$(ss_tunnel_LINK) $(ss_tunnel_OBJECTS) $(ss_tunnel_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -425,347 +503,350 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< ss_local-utils.o: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-utils.o -MD -MP -MF $(DEPDIR)/ss_local-utils.Tpo -c -o ss_local-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-utils.Tpo $(DEPDIR)/ss_local-utils.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='ss_local-utils.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-utils.o -MD -MP -MF $(DEPDIR)/ss_local-utils.Tpo -c -o ss_local-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-utils.Tpo $(DEPDIR)/ss_local-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='ss_local-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c ss_local-utils.obj: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-utils.obj -MD -MP -MF $(DEPDIR)/ss_local-utils.Tpo -c -o ss_local-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-utils.Tpo $(DEPDIR)/ss_local-utils.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='ss_local-utils.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-utils.obj -MD -MP -MF $(DEPDIR)/ss_local-utils.Tpo -c -o ss_local-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-utils.Tpo $(DEPDIR)/ss_local-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='ss_local-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` ss_local-jconf.o: jconf.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-jconf.o -MD -MP -MF $(DEPDIR)/ss_local-jconf.Tpo -c -o ss_local-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-jconf.Tpo $(DEPDIR)/ss_local-jconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jconf.c' object='ss_local-jconf.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-jconf.o -MD -MP -MF $(DEPDIR)/ss_local-jconf.Tpo -c -o ss_local-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-jconf.Tpo $(DEPDIR)/ss_local-jconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='jconf.c' object='ss_local-jconf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c ss_local-jconf.obj: jconf.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-jconf.obj -MD -MP -MF $(DEPDIR)/ss_local-jconf.Tpo -c -o ss_local-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-jconf.Tpo $(DEPDIR)/ss_local-jconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jconf.c' object='ss_local-jconf.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-jconf.obj -MD -MP -MF $(DEPDIR)/ss_local-jconf.Tpo -c -o ss_local-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-jconf.Tpo $(DEPDIR)/ss_local-jconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='jconf.c' object='ss_local-jconf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` ss_local-json.o: json.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-json.o -MD -MP -MF $(DEPDIR)/ss_local-json.Tpo -c -o ss_local-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-json.Tpo $(DEPDIR)/ss_local-json.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='json.c' object='ss_local-json.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-json.o -MD -MP -MF $(DEPDIR)/ss_local-json.Tpo -c -o ss_local-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-json.Tpo $(DEPDIR)/ss_local-json.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='ss_local-json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c ss_local-json.obj: json.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-json.obj -MD -MP -MF $(DEPDIR)/ss_local-json.Tpo -c -o ss_local-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-json.Tpo $(DEPDIR)/ss_local-json.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='json.c' object='ss_local-json.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-json.obj -MD -MP -MF $(DEPDIR)/ss_local-json.Tpo -c -o ss_local-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-json.Tpo $(DEPDIR)/ss_local-json.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='ss_local-json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` ss_local-encrypt.o: encrypt.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-encrypt.o -MD -MP -MF $(DEPDIR)/ss_local-encrypt.Tpo -c -o ss_local-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-encrypt.Tpo $(DEPDIR)/ss_local-encrypt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='encrypt.c' object='ss_local-encrypt.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-encrypt.o -MD -MP -MF $(DEPDIR)/ss_local-encrypt.Tpo -c -o ss_local-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-encrypt.Tpo $(DEPDIR)/ss_local-encrypt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encrypt.c' object='ss_local-encrypt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c ss_local-encrypt.obj: encrypt.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-encrypt.obj -MD -MP -MF $(DEPDIR)/ss_local-encrypt.Tpo -c -o ss_local-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-encrypt.Tpo $(DEPDIR)/ss_local-encrypt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='encrypt.c' object='ss_local-encrypt.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-encrypt.obj -MD -MP -MF $(DEPDIR)/ss_local-encrypt.Tpo -c -o ss_local-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-encrypt.Tpo $(DEPDIR)/ss_local-encrypt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encrypt.c' object='ss_local-encrypt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` ss_local-udprelay.o: udprelay.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-udprelay.o -MD -MP -MF $(DEPDIR)/ss_local-udprelay.Tpo -c -o ss_local-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-udprelay.Tpo $(DEPDIR)/ss_local-udprelay.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udprelay.c' object='ss_local-udprelay.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-udprelay.o -MD -MP -MF $(DEPDIR)/ss_local-udprelay.Tpo -c -o ss_local-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-udprelay.Tpo $(DEPDIR)/ss_local-udprelay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='udprelay.c' object='ss_local-udprelay.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c ss_local-udprelay.obj: udprelay.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-udprelay.obj -MD -MP -MF $(DEPDIR)/ss_local-udprelay.Tpo -c -o ss_local-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-udprelay.Tpo $(DEPDIR)/ss_local-udprelay.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udprelay.c' object='ss_local-udprelay.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-udprelay.obj -MD -MP -MF $(DEPDIR)/ss_local-udprelay.Tpo -c -o ss_local-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-udprelay.Tpo $(DEPDIR)/ss_local-udprelay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='udprelay.c' object='ss_local-udprelay.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` ss_local-cache.o: cache.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-cache.o -MD -MP -MF $(DEPDIR)/ss_local-cache.Tpo -c -o ss_local-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-cache.Tpo $(DEPDIR)/ss_local-cache.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache.c' object='ss_local-cache.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-cache.o -MD -MP -MF $(DEPDIR)/ss_local-cache.Tpo -c -o ss_local-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-cache.Tpo $(DEPDIR)/ss_local-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='ss_local-cache.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c ss_local-cache.obj: cache.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-cache.obj -MD -MP -MF $(DEPDIR)/ss_local-cache.Tpo -c -o ss_local-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-cache.Tpo $(DEPDIR)/ss_local-cache.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache.c' object='ss_local-cache.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-cache.obj -MD -MP -MF $(DEPDIR)/ss_local-cache.Tpo -c -o ss_local-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-cache.Tpo $(DEPDIR)/ss_local-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='ss_local-cache.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` ss_local-local.o: local.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-local.o -MD -MP -MF $(DEPDIR)/ss_local-local.Tpo -c -o ss_local-local.o `test -f 'local.c' || echo '$(srcdir)/'`local.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-local.Tpo $(DEPDIR)/ss_local-local.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local.c' object='ss_local-local.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-local.o -MD -MP -MF $(DEPDIR)/ss_local-local.Tpo -c -o ss_local-local.o `test -f 'local.c' || echo '$(srcdir)/'`local.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-local.Tpo $(DEPDIR)/ss_local-local.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local.c' object='ss_local-local.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-local.o `test -f 'local.c' || echo '$(srcdir)/'`local.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-local.o `test -f 'local.c' || echo '$(srcdir)/'`local.c ss_local-local.obj: local.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-local.obj -MD -MP -MF $(DEPDIR)/ss_local-local.Tpo -c -o ss_local-local.obj `if test -f 'local.c'; then $(CYGPATH_W) 'local.c'; else $(CYGPATH_W) '$(srcdir)/local.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-local.Tpo $(DEPDIR)/ss_local-local.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='local.c' object='ss_local-local.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-local.obj -MD -MP -MF $(DEPDIR)/ss_local-local.Tpo -c -o ss_local-local.obj `if test -f 'local.c'; then $(CYGPATH_W) 'local.c'; else $(CYGPATH_W) '$(srcdir)/local.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-local.Tpo $(DEPDIR)/ss_local-local.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='local.c' object='ss_local-local.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-local.obj `if test -f 'local.c'; then $(CYGPATH_W) 'local.c'; else $(CYGPATH_W) '$(srcdir)/local.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-local.obj `if test -f 'local.c'; then $(CYGPATH_W) 'local.c'; else $(CYGPATH_W) '$(srcdir)/local.c'; fi` ss_local-win32.o: win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-win32.o -MD -MP -MF $(DEPDIR)/ss_local-win32.Tpo -c -o ss_local-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-win32.Tpo $(DEPDIR)/ss_local-win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='win32.c' object='ss_local-win32.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-win32.o -MD -MP -MF $(DEPDIR)/ss_local-win32.Tpo -c -o ss_local-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-win32.Tpo $(DEPDIR)/ss_local-win32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='win32.c' object='ss_local-win32.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c ss_local-win32.obj: win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-win32.obj -MD -MP -MF $(DEPDIR)/ss_local-win32.Tpo -c -o ss_local-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_local-win32.Tpo $(DEPDIR)/ss_local-win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='win32.c' object='ss_local-win32.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -MT ss_local-win32.obj -MD -MP -MF $(DEPDIR)/ss_local-win32.Tpo -c -o ss_local-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_local-win32.Tpo $(DEPDIR)/ss_local-win32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='win32.c' object='ss_local-win32.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_local_CFLAGS) $(CFLAGS) -c -o ss_local-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` ss_server-utils.o: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-utils.o -MD -MP -MF $(DEPDIR)/ss_server-utils.Tpo -c -o ss_server-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-utils.Tpo $(DEPDIR)/ss_server-utils.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='ss_server-utils.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-utils.o -MD -MP -MF $(DEPDIR)/ss_server-utils.Tpo -c -o ss_server-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-utils.Tpo $(DEPDIR)/ss_server-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='ss_server-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c ss_server-utils.obj: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-utils.obj -MD -MP -MF $(DEPDIR)/ss_server-utils.Tpo -c -o ss_server-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-utils.Tpo $(DEPDIR)/ss_server-utils.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='ss_server-utils.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-utils.obj -MD -MP -MF $(DEPDIR)/ss_server-utils.Tpo -c -o ss_server-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-utils.Tpo $(DEPDIR)/ss_server-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='ss_server-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` ss_server-jconf.o: jconf.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-jconf.o -MD -MP -MF $(DEPDIR)/ss_server-jconf.Tpo -c -o ss_server-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-jconf.Tpo $(DEPDIR)/ss_server-jconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jconf.c' object='ss_server-jconf.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-jconf.o -MD -MP -MF $(DEPDIR)/ss_server-jconf.Tpo -c -o ss_server-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-jconf.Tpo $(DEPDIR)/ss_server-jconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='jconf.c' object='ss_server-jconf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c ss_server-jconf.obj: jconf.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-jconf.obj -MD -MP -MF $(DEPDIR)/ss_server-jconf.Tpo -c -o ss_server-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-jconf.Tpo $(DEPDIR)/ss_server-jconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jconf.c' object='ss_server-jconf.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-jconf.obj -MD -MP -MF $(DEPDIR)/ss_server-jconf.Tpo -c -o ss_server-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-jconf.Tpo $(DEPDIR)/ss_server-jconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='jconf.c' object='ss_server-jconf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` ss_server-json.o: json.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-json.o -MD -MP -MF $(DEPDIR)/ss_server-json.Tpo -c -o ss_server-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-json.Tpo $(DEPDIR)/ss_server-json.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='json.c' object='ss_server-json.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-json.o -MD -MP -MF $(DEPDIR)/ss_server-json.Tpo -c -o ss_server-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-json.Tpo $(DEPDIR)/ss_server-json.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='ss_server-json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c ss_server-json.obj: json.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-json.obj -MD -MP -MF $(DEPDIR)/ss_server-json.Tpo -c -o ss_server-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-json.Tpo $(DEPDIR)/ss_server-json.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='json.c' object='ss_server-json.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-json.obj -MD -MP -MF $(DEPDIR)/ss_server-json.Tpo -c -o ss_server-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-json.Tpo $(DEPDIR)/ss_server-json.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='ss_server-json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` ss_server-encrypt.o: encrypt.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-encrypt.o -MD -MP -MF $(DEPDIR)/ss_server-encrypt.Tpo -c -o ss_server-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-encrypt.Tpo $(DEPDIR)/ss_server-encrypt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='encrypt.c' object='ss_server-encrypt.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-encrypt.o -MD -MP -MF $(DEPDIR)/ss_server-encrypt.Tpo -c -o ss_server-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-encrypt.Tpo $(DEPDIR)/ss_server-encrypt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encrypt.c' object='ss_server-encrypt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c ss_server-encrypt.obj: encrypt.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-encrypt.obj -MD -MP -MF $(DEPDIR)/ss_server-encrypt.Tpo -c -o ss_server-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-encrypt.Tpo $(DEPDIR)/ss_server-encrypt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='encrypt.c' object='ss_server-encrypt.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-encrypt.obj -MD -MP -MF $(DEPDIR)/ss_server-encrypt.Tpo -c -o ss_server-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-encrypt.Tpo $(DEPDIR)/ss_server-encrypt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encrypt.c' object='ss_server-encrypt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` ss_server-udprelay.o: udprelay.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-udprelay.o -MD -MP -MF $(DEPDIR)/ss_server-udprelay.Tpo -c -o ss_server-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-udprelay.Tpo $(DEPDIR)/ss_server-udprelay.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udprelay.c' object='ss_server-udprelay.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-udprelay.o -MD -MP -MF $(DEPDIR)/ss_server-udprelay.Tpo -c -o ss_server-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-udprelay.Tpo $(DEPDIR)/ss_server-udprelay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='udprelay.c' object='ss_server-udprelay.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c ss_server-udprelay.obj: udprelay.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-udprelay.obj -MD -MP -MF $(DEPDIR)/ss_server-udprelay.Tpo -c -o ss_server-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-udprelay.Tpo $(DEPDIR)/ss_server-udprelay.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udprelay.c' object='ss_server-udprelay.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-udprelay.obj -MD -MP -MF $(DEPDIR)/ss_server-udprelay.Tpo -c -o ss_server-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-udprelay.Tpo $(DEPDIR)/ss_server-udprelay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='udprelay.c' object='ss_server-udprelay.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` ss_server-cache.o: cache.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-cache.o -MD -MP -MF $(DEPDIR)/ss_server-cache.Tpo -c -o ss_server-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-cache.Tpo $(DEPDIR)/ss_server-cache.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache.c' object='ss_server-cache.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-cache.o -MD -MP -MF $(DEPDIR)/ss_server-cache.Tpo -c -o ss_server-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-cache.Tpo $(DEPDIR)/ss_server-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='ss_server-cache.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c ss_server-cache.obj: cache.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-cache.obj -MD -MP -MF $(DEPDIR)/ss_server-cache.Tpo -c -o ss_server-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-cache.Tpo $(DEPDIR)/ss_server-cache.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache.c' object='ss_server-cache.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-cache.obj -MD -MP -MF $(DEPDIR)/ss_server-cache.Tpo -c -o ss_server-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-cache.Tpo $(DEPDIR)/ss_server-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='ss_server-cache.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` ss_server-server.o: server.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-server.o -MD -MP -MF $(DEPDIR)/ss_server-server.Tpo -c -o ss_server-server.o `test -f 'server.c' || echo '$(srcdir)/'`server.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-server.Tpo $(DEPDIR)/ss_server-server.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='server.c' object='ss_server-server.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-server.o -MD -MP -MF $(DEPDIR)/ss_server-server.Tpo -c -o ss_server-server.o `test -f 'server.c' || echo '$(srcdir)/'`server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-server.Tpo $(DEPDIR)/ss_server-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='server.c' object='ss_server-server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-server.o `test -f 'server.c' || echo '$(srcdir)/'`server.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-server.o `test -f 'server.c' || echo '$(srcdir)/'`server.c ss_server-server.obj: server.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-server.obj -MD -MP -MF $(DEPDIR)/ss_server-server.Tpo -c -o ss_server-server.obj `if test -f 'server.c'; then $(CYGPATH_W) 'server.c'; else $(CYGPATH_W) '$(srcdir)/server.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_server-server.Tpo $(DEPDIR)/ss_server-server.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='server.c' object='ss_server-server.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -MT ss_server-server.obj -MD -MP -MF $(DEPDIR)/ss_server-server.Tpo -c -o ss_server-server.obj `if test -f 'server.c'; then $(CYGPATH_W) 'server.c'; else $(CYGPATH_W) '$(srcdir)/server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_server-server.Tpo $(DEPDIR)/ss_server-server.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='server.c' object='ss_server-server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-server.obj `if test -f 'server.c'; then $(CYGPATH_W) 'server.c'; else $(CYGPATH_W) '$(srcdir)/server.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_server_CFLAGS) $(CFLAGS) -c -o ss_server-server.obj `if test -f 'server.c'; then $(CYGPATH_W) 'server.c'; else $(CYGPATH_W) '$(srcdir)/server.c'; fi` ss_tunnel-utils.o: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-utils.o -MD -MP -MF $(DEPDIR)/ss_tunnel-utils.Tpo -c -o ss_tunnel-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-utils.Tpo $(DEPDIR)/ss_tunnel-utils.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='ss_tunnel-utils.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-utils.o -MD -MP -MF $(DEPDIR)/ss_tunnel-utils.Tpo -c -o ss_tunnel-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-utils.Tpo $(DEPDIR)/ss_tunnel-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='ss_tunnel-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-utils.o `test -f 'utils.c' || echo '$(srcdir)/'`utils.c ss_tunnel-utils.obj: utils.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-utils.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-utils.Tpo -c -o ss_tunnel-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-utils.Tpo $(DEPDIR)/ss_tunnel-utils.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='utils.c' object='ss_tunnel-utils.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-utils.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-utils.Tpo -c -o ss_tunnel-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-utils.Tpo $(DEPDIR)/ss_tunnel-utils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='utils.c' object='ss_tunnel-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-utils.obj `if test -f 'utils.c'; then $(CYGPATH_W) 'utils.c'; else $(CYGPATH_W) '$(srcdir)/utils.c'; fi` ss_tunnel-jconf.o: jconf.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-jconf.o -MD -MP -MF $(DEPDIR)/ss_tunnel-jconf.Tpo -c -o ss_tunnel-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-jconf.Tpo $(DEPDIR)/ss_tunnel-jconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jconf.c' object='ss_tunnel-jconf.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-jconf.o -MD -MP -MF $(DEPDIR)/ss_tunnel-jconf.Tpo -c -o ss_tunnel-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-jconf.Tpo $(DEPDIR)/ss_tunnel-jconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='jconf.c' object='ss_tunnel-jconf.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-jconf.o `test -f 'jconf.c' || echo '$(srcdir)/'`jconf.c ss_tunnel-jconf.obj: jconf.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-jconf.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-jconf.Tpo -c -o ss_tunnel-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-jconf.Tpo $(DEPDIR)/ss_tunnel-jconf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='jconf.c' object='ss_tunnel-jconf.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-jconf.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-jconf.Tpo -c -o ss_tunnel-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-jconf.Tpo $(DEPDIR)/ss_tunnel-jconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='jconf.c' object='ss_tunnel-jconf.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-jconf.obj `if test -f 'jconf.c'; then $(CYGPATH_W) 'jconf.c'; else $(CYGPATH_W) '$(srcdir)/jconf.c'; fi` ss_tunnel-json.o: json.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-json.o -MD -MP -MF $(DEPDIR)/ss_tunnel-json.Tpo -c -o ss_tunnel-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-json.Tpo $(DEPDIR)/ss_tunnel-json.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='json.c' object='ss_tunnel-json.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-json.o -MD -MP -MF $(DEPDIR)/ss_tunnel-json.Tpo -c -o ss_tunnel-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-json.Tpo $(DEPDIR)/ss_tunnel-json.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='ss_tunnel-json.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-json.o `test -f 'json.c' || echo '$(srcdir)/'`json.c ss_tunnel-json.obj: json.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-json.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-json.Tpo -c -o ss_tunnel-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-json.Tpo $(DEPDIR)/ss_tunnel-json.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='json.c' object='ss_tunnel-json.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-json.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-json.Tpo -c -o ss_tunnel-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-json.Tpo $(DEPDIR)/ss_tunnel-json.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='json.c' object='ss_tunnel-json.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-json.obj `if test -f 'json.c'; then $(CYGPATH_W) 'json.c'; else $(CYGPATH_W) '$(srcdir)/json.c'; fi` ss_tunnel-encrypt.o: encrypt.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-encrypt.o -MD -MP -MF $(DEPDIR)/ss_tunnel-encrypt.Tpo -c -o ss_tunnel-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-encrypt.Tpo $(DEPDIR)/ss_tunnel-encrypt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='encrypt.c' object='ss_tunnel-encrypt.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-encrypt.o -MD -MP -MF $(DEPDIR)/ss_tunnel-encrypt.Tpo -c -o ss_tunnel-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-encrypt.Tpo $(DEPDIR)/ss_tunnel-encrypt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encrypt.c' object='ss_tunnel-encrypt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-encrypt.o `test -f 'encrypt.c' || echo '$(srcdir)/'`encrypt.c ss_tunnel-encrypt.obj: encrypt.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-encrypt.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-encrypt.Tpo -c -o ss_tunnel-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-encrypt.Tpo $(DEPDIR)/ss_tunnel-encrypt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='encrypt.c' object='ss_tunnel-encrypt.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-encrypt.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-encrypt.Tpo -c -o ss_tunnel-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-encrypt.Tpo $(DEPDIR)/ss_tunnel-encrypt.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encrypt.c' object='ss_tunnel-encrypt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-encrypt.obj `if test -f 'encrypt.c'; then $(CYGPATH_W) 'encrypt.c'; else $(CYGPATH_W) '$(srcdir)/encrypt.c'; fi` ss_tunnel-udprelay.o: udprelay.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-udprelay.o -MD -MP -MF $(DEPDIR)/ss_tunnel-udprelay.Tpo -c -o ss_tunnel-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-udprelay.Tpo $(DEPDIR)/ss_tunnel-udprelay.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udprelay.c' object='ss_tunnel-udprelay.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-udprelay.o -MD -MP -MF $(DEPDIR)/ss_tunnel-udprelay.Tpo -c -o ss_tunnel-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-udprelay.Tpo $(DEPDIR)/ss_tunnel-udprelay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='udprelay.c' object='ss_tunnel-udprelay.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-udprelay.o `test -f 'udprelay.c' || echo '$(srcdir)/'`udprelay.c ss_tunnel-udprelay.obj: udprelay.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-udprelay.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-udprelay.Tpo -c -o ss_tunnel-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-udprelay.Tpo $(DEPDIR)/ss_tunnel-udprelay.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='udprelay.c' object='ss_tunnel-udprelay.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-udprelay.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-udprelay.Tpo -c -o ss_tunnel-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-udprelay.Tpo $(DEPDIR)/ss_tunnel-udprelay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='udprelay.c' object='ss_tunnel-udprelay.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-udprelay.obj `if test -f 'udprelay.c'; then $(CYGPATH_W) 'udprelay.c'; else $(CYGPATH_W) '$(srcdir)/udprelay.c'; fi` ss_tunnel-cache.o: cache.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-cache.o -MD -MP -MF $(DEPDIR)/ss_tunnel-cache.Tpo -c -o ss_tunnel-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-cache.Tpo $(DEPDIR)/ss_tunnel-cache.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache.c' object='ss_tunnel-cache.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-cache.o -MD -MP -MF $(DEPDIR)/ss_tunnel-cache.Tpo -c -o ss_tunnel-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-cache.Tpo $(DEPDIR)/ss_tunnel-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='ss_tunnel-cache.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-cache.o `test -f 'cache.c' || echo '$(srcdir)/'`cache.c ss_tunnel-cache.obj: cache.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-cache.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-cache.Tpo -c -o ss_tunnel-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-cache.Tpo $(DEPDIR)/ss_tunnel-cache.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache.c' object='ss_tunnel-cache.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-cache.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-cache.Tpo -c -o ss_tunnel-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-cache.Tpo $(DEPDIR)/ss_tunnel-cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cache.c' object='ss_tunnel-cache.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-cache.obj `if test -f 'cache.c'; then $(CYGPATH_W) 'cache.c'; else $(CYGPATH_W) '$(srcdir)/cache.c'; fi` ss_tunnel-tunnel.o: tunnel.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-tunnel.o -MD -MP -MF $(DEPDIR)/ss_tunnel-tunnel.Tpo -c -o ss_tunnel-tunnel.o `test -f 'tunnel.c' || echo '$(srcdir)/'`tunnel.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-tunnel.Tpo $(DEPDIR)/ss_tunnel-tunnel.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tunnel.c' object='ss_tunnel-tunnel.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-tunnel.o -MD -MP -MF $(DEPDIR)/ss_tunnel-tunnel.Tpo -c -o ss_tunnel-tunnel.o `test -f 'tunnel.c' || echo '$(srcdir)/'`tunnel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-tunnel.Tpo $(DEPDIR)/ss_tunnel-tunnel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tunnel.c' object='ss_tunnel-tunnel.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-tunnel.o `test -f 'tunnel.c' || echo '$(srcdir)/'`tunnel.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-tunnel.o `test -f 'tunnel.c' || echo '$(srcdir)/'`tunnel.c ss_tunnel-tunnel.obj: tunnel.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-tunnel.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-tunnel.Tpo -c -o ss_tunnel-tunnel.obj `if test -f 'tunnel.c'; then $(CYGPATH_W) 'tunnel.c'; else $(CYGPATH_W) '$(srcdir)/tunnel.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-tunnel.Tpo $(DEPDIR)/ss_tunnel-tunnel.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tunnel.c' object='ss_tunnel-tunnel.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-tunnel.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-tunnel.Tpo -c -o ss_tunnel-tunnel.obj `if test -f 'tunnel.c'; then $(CYGPATH_W) 'tunnel.c'; else $(CYGPATH_W) '$(srcdir)/tunnel.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-tunnel.Tpo $(DEPDIR)/ss_tunnel-tunnel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tunnel.c' object='ss_tunnel-tunnel.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-tunnel.obj `if test -f 'tunnel.c'; then $(CYGPATH_W) 'tunnel.c'; else $(CYGPATH_W) '$(srcdir)/tunnel.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-tunnel.obj `if test -f 'tunnel.c'; then $(CYGPATH_W) 'tunnel.c'; else $(CYGPATH_W) '$(srcdir)/tunnel.c'; fi` ss_tunnel-win32.o: win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-win32.o -MD -MP -MF $(DEPDIR)/ss_tunnel-win32.Tpo -c -o ss_tunnel-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-win32.Tpo $(DEPDIR)/ss_tunnel-win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='win32.c' object='ss_tunnel-win32.o' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-win32.o -MD -MP -MF $(DEPDIR)/ss_tunnel-win32.Tpo -c -o ss_tunnel-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-win32.Tpo $(DEPDIR)/ss_tunnel-win32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='win32.c' object='ss_tunnel-win32.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-win32.o `test -f 'win32.c' || echo '$(srcdir)/'`win32.c ss_tunnel-win32.obj: win32.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-win32.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-win32.Tpo -c -o ss_tunnel-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ss_tunnel-win32.Tpo $(DEPDIR)/ss_tunnel-win32.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='win32.c' object='ss_tunnel-win32.obj' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -MT ss_tunnel-win32.obj -MD -MP -MF $(DEPDIR)/ss_tunnel-win32.Tpo -c -o ss_tunnel-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/ss_tunnel-win32.Tpo $(DEPDIR)/ss_tunnel-win32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='win32.c' object='ss_tunnel-win32.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ss_tunnel_CFLAGS) $(CFLAGS) -c -o ss_tunnel-win32.obj `if test -f 'win32.c'; then $(CYGPATH_W) 'win32.c'; else $(CYGPATH_W) '$(srcdir)/win32.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -773,26 +854,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -804,15 +874,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -821,6 +887,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -964,19 +1045,19 @@ uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am \ - uninstall-binPROGRAMS +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables.