ztc-3.1.0.31/0000755000175000017500000000000010662321241011224 5ustar kylekyleztc-3.1.0.31/Makefile.in0000644000175000017500000004337210662320061013301 0ustar kylekyle# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure COPYING INSTALL depcomp install-sh \ missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ SUBDIRS = src all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 uninstall-info-am: # 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): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @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; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done 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; } \ END { 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=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-info-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: ztc-3.1.0.31/config.h.in0000644000175000017500000000542710662320061013256 0ustar kylekyle/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `unsigned' if does not define. */ #undef size_t ztc-3.1.0.31/COPYING0000644000175000017500000000273110662320061012261 0ustar kylekyleCopyright (C) 2004-2007 Intel Corp. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Intel Corp. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ztc-3.1.0.31/README0000644000175000017500000000260310662320061012104 0ustar kylekyle//---------------------------------------------------------------------------- // // Copyright (C) Intel Corporation, 2003 - 2007. // // File: README // // Contents: Intel(R) Active Management Technology (Intel(R) AMT): // A short description of the ZTCLocalAgent sample code // for the usage of developers // //---------------------------------------------------------------------------- ZTCLocalAgent sample application: --------------------------------- This sample application demonstrates how to set up an Intel(R) AMT device for Zero Touch Configuration (ZTC) and trigger it to initiate the configuration process. Installing and uninstalling the ZTCLocalAgent: --------------------------------- In order to build and install the ZTCLocalAgent, call "./configure" and then "make install". The application is installed in "/usr/local/intel/ZTCLocalAgent", by default. Use "./configure --help" for more options. Call "make uninstall" to remove the ZTCLocalAgent. Running the ZTCLocalAgent: --------------------------------- Running the ZTCLocalAgent requires Intel(R) Manageability Engine Interface Driver to be loaded. Use the application as described in the command usage (type the command to obtain the usage instructions). ------------------------------------------------------------------- * Other names and brands may be claimed as the property of others. ztc-3.1.0.31/Makefile.am0000644000175000017500000000001410662320061013252 0ustar kylekyleSUBDIRS=src ztc-3.1.0.31/missing0000755000175000017500000002540610662320061012631 0ustar kylekyle#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # 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 ;; -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. 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' 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 tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # 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). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) 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 # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" 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 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -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 [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -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 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 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 's/.*-o \([^ ]*\).*/\1/p'` 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 ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) 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 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ztc-3.1.0.31/depcomp0000755000175000017500000003710010662320061012601 0ustar kylekyle#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## 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). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else 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. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$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. ## 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" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | 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" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # 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,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$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" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -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 ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; 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$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism 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 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 stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" 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" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$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" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## 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" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ztc-3.1.0.31/configure0000755000175000017500000057333210662320061013147 0ustar kylekyle#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for ZTC 3.1. # # Report bugs to . # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='ZTC' PACKAGE_TARNAME='ztc' PACKAGE_VERSION='3.1' PACKAGE_STRING='ZTC 3.1' PACKAGE_BUGREPORT='www.intel.com' ac_unique_file="src/ZTCLocalAgent.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures ZTC 3.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of ZTC 3.1:";; esac cat <<\_ACEOF Optional Features: --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 Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF ZTC configure 3.1 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by ZTC $as_me 3.1, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 am__api_version="1.9" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # 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". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='ztc' VERSION='3.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" # Checks for programs. ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C++ compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C++ compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f 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 depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 # Checks for header files. echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h memory.h stdint.h stdlib.h string.h strings.h sys/ioctl.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to www.intel.com ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool # error bool is not defined #endif #ifndef false # error false is not defined #endif #if false # error false is not 0 #endif #ifndef true # error true is not defined #endif #if true != 1 # error true is not 1 #endif #ifndef __bool_true_false_are_defined # error __bool_true_false_are_defined is not defined #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) -0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) -0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; int main () { return !a + !b + !c + !d + !e + !f + !g + !h + !i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((_Bool *) 0) return 0; if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6 if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi # Checks for library functions. if test $ac_cv_c_compiler_gnu = yes; then echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to www.intel.com ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if STDC_HEADERS || HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { exit (malloc (0) ? 0 : 1); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case $LIBOBJS in "malloc.$ac_objext" | \ *" malloc.$ac_objext" | \ "malloc.$ac_objext "* | \ *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi echo "$as_me:$LINENO: checking for working memcmp" >&5 echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 if test "${ac_cv_func_memcmp_working+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_memcmp_working=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = 0x40, c1 = 0x80, c2 = 0x81; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) exit (1); /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) exit (1); } exit (0); } ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memcmp_working=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_memcmp_working=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5 echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 test $ac_cv_func_memcmp_working = no && case $LIBOBJS in "memcmp.$ac_objext" | \ *" memcmp.$ac_objext" | \ "memcmp.$ac_objext "* | \ *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in sys/select.h sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------- ## ## Report this to www.intel.com ## ## ---------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking types of arguments for select" >&5 echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 if test "${ac_cv_func_select_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #if HAVE_SYS_SELECT_H # include #endif #if HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : ${ac_cv_func_select_args='int,int *,struct timeval *'} fi echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 echo "${ECHO_T}$ac_cv_func_select_args" >&6 ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* for ac_func in memset select strchr strrchr do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files src/Makefile Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by ZTC $as_me 3.1, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ ZTC config.status 3.1 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'`/stamp-h$_am_stamp_count done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # 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 # 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. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # 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 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 # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ztc-3.1.0.31/install-sh0000755000175000017500000002202110662320061013224 0ustar kylekyle#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ztc-3.1.0.31/src/0000755000175000017500000000000010662321241012013 5ustar kylekyleztc-3.1.0.31/src/StatusStrings.str0000644000175000017500000003101410662320062015401 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #include "StatusCodeDefinitions.h" PT_STATUS_SUCCESS "PT_STATUS_SUCCESS: The request succeeded." PT_STATUS_INTERNAL_ERROR "PT_STATUS_INTERNAL_ERROR: An internal error in the Intel(R) AMT device has occurred." PT_STATUS_NOT_READY "PT_STATUS_NOT_READY: Intel(R) AMT device has not progressed far enough in its initialization to process the command." PT_STATUS_INVALID_PT_MODE "PT_STATUS_INVALID_PT_MODE: Command is not permitted in current operating mode." PT_STATUS_INVALID_MESSAGE_LENGTH "PT_STATUS_INVALID_MESSAGE_LENGTH: Length field of header is invalid." PT_STATUS_TABLE_FINGERPRINT_NOT_AVAILABLE "PT_STATUS_TABLE_FINGERPRINT_NOT_AVAILABLE: The requested hardware asset inventory table checksum is not available." PT_STATUS_INTEGRITY_CHECK_FAILED "PT_STATUS_INTEGRITY_CHECK_FAILED: The Integrity Check Value field of the request message sent by Intel(R) AMT enabled device is invalid." PT_STATUS_UNSUPPORTED_ISVS_VERSION "PT_STATUS_UNSUPPORTED_ISVS_VERSION: The specified ISV version is not supported." PT_STATUS_APPLICATION_NOT_REGISTERED "PT_STATUS_APPLICATION_NOT_REGISTERED: The specified queried application is not registered." PT_STATUS_INVALID_REGISTRATION_DATA "PT_STATUS_INVALID_REGISTRATION_DATA: Either an invalid name or a not previously registered Enterprise name was specified." PT_STATUS_APPLICATION_DOES_NOT_EXIST "PT_STATUS_APPLICATION_DOES_NOT_EXIST: The application handle provided in the request message has never been allocated." PT_STATUS_NOT_ENOUGH_STORAGE "PT_STATUS_NOT_ENOUGH_STORAGE: The requested number of bytes cannot be allocated in ISV storage." PT_STATUS_INVALID_NAME "PT_STATUS_INVALID_NAME: The specified name is invalid." PT_STATUS_BLOCK_DOES_NOT_EXIST "PT_STATUS_BLOCK_DOES_NOT_EXIST: The specified block does not exist." PT_STATUS_INVALID_BYTE_OFFSET "PT_STATUS_INVALID_BYTE_OFFSET: The specified byte offset is invalid." PT_STATUS_INVALID_BYTE_COUNT "PT_STATUS_INVALID_BYTE_COUNT: The specified byte count is invalid." PT_STATUS_NOT_PERMITTED "PT_STATUS_NOT_PERMITTED: The requesting application is not permitted to request execution of the specified operation." PT_STATUS_NOT_OWNER "PT_STATUS_NOT_OWNER: The requesting application is not the owner of the block as required for the requested operation." PT_STATUS_BLOCK_LOCKED_BY_OTHER "PT_STATUS_BLOCK_LOCKED_BY_OTHER: The specified block is locked by another application." PT_STATUS_BLOCK_NOT_LOCKED "PT_STATUS_BLOCK_NOT_LOCKED: The specified block is not locked." PT_STATUS_INVALID_GROUP_PERMISSIONS "PT_STATUS_INVALID_GROUP_PERMISSIONS: The specified group permission bits are invalid." PT_STATUS_GROUP_DOES_NOT_EXIST "PT_STATUS_GROUP_DOES_NOT_EXIST: The specified group does not exist." PT_STATUS_INVALID_MEMBER_COUNT "PT_STATUS_INVALID_MEMBER_COUNT: The specified member count is invalid." PT_STATUS_MAX_LIMIT_REACHED "PT_STATUS_MAX_LIMIT_REACHED: The request cannot be satisfied because a maximum limit associated with the request has been reached." PT_STATUS_INVALID_AUTH_TYPE "PT_STATUS_INVALID_AUTH_TYPE: The specified key algorithm is invalid." PT_STATUS_AUTHENTICATION_FAILED "PT_STATUS_AUTHENTICATION_FAILED: Authentication failed." PT_STATUS_INVALID_DHCP_MODE "PT_STATUS_INVALID_DHCP_MODE: The specified DHCP mode is invalid." PT_STATUS_INVALID_IP_ADDRESS "PT_STATUS_INVALID_IP_ADDRESS: The specified IP address is not a valid IP unicast address." PT_STATUS_INVALID_DOMAIN_NAME "PT_STATUS_INVALID_DOMAIN_NAME: The specified domain name is not a valid domain name." PT_STATUS_UNSUPPORTED_VERSION "PT_STATUS_UNSUPPORTED_VERSION: Unsupported version." PT_STATUS_REQUEST_UNEXPECTED "PT_STATUS_REQUEST_UNEXPECTED: The requested operation cannot be performed because a prerequisite request message has not been received." PT_STATUS_INVALID_TABLE_TYPE "PT_STATUS_INVALID_TABLE_TYPE: Invalid Table type." PT_STATUS_INVALID_PROVISIONING_STATE "PT_STATUS_INVALID_PROVISIONING_STATE: The specified provisioning mode code is undefined." PT_STATUS_UNSUPPORTED_OBJECT "PT_STATUS_UNSUPPORTED_OBJECT: Unsupported object." PT_STATUS_INVALID_TIME "PT_STATUS_INVALID_TIME: The specified time was not accepted by the Intel(R) AMT device since it is earlier than the baseline time set for the device." PT_STATUS_INVALID_INDEX "PT_STATUS_INVALID_INDEX: Starting Index is invalid." PT_STATUS_INVALID_PARAMETER "PT_STATUS_INVALID_PARAMETER: Specified parameter is invalid." PT_STATUS_INVALID_NETMASK "PT_STATUS_INVALID_NETMASK: An invalid netmask was supplied (a valid netmask is an IP address in which all '1's are before the '0' - e.g. FFFC0000h is valid, FF0C0000h is invalid)." PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED "PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED: The operation failed because the Flash wear-out protection mechanism prevented a write to an NVRAM sector." PT_STATUS_INVALID_IMAGE_LENGTH "PT_STATUS_INVALID_IMAGE_LENGTH: ME FW did not receive the entire image file." PT_STATUS_INVALID_IMAGE_SIGNATURE "PT_STATUS_INVALID_IMAGE_SIGNATURE: ME FW received an image file with an invalid signature." PT_STATUS_PROPOSE_ANOTHER_VERSION "PT_STATUS_PROPOSE_ANOTHER_VERSION: LME can not support the requested version." PT_STATUS_INVALID_PID_FORMAT "PT_STATUS_INVALID_PID_FORMAT: The PID must be a 64 bit quantity made up of ASCII codes of some combination of 8 characters - capital letters (A-Z), and numbers (0-9)." PT_STATUS_INVALID_PPS_FORMAT "PT_STATUS_INVALID_PPS_FORMAT: The PPS must be a 256 bit quantity made up of ASCII codes of some combination of 32 characters - capital letters (A-Z), and numbers (0-9)." PT_STATUS_BIST_COMMAND_BLOCKED "PT_STATUS_BIST_COMMAND_BLOCKED: Full BIST test has been blocked." PT_STATUS_CONNECTION_FAILED "PT_STATUS_CONNECTION_FAILED: A TCP/IP connection could not be opened on with the selected port." PT_STATUS_CONNECTION_TOO_MANY "PT_STATUS_CONNECTION_TOO_MANY: Max number of connections reached. LME can not open the requested connection." PT_STATUS_RNG_GENERATION_IN_PROGRESS "PT_STATUS_RNG_GENERATION_IN_PROGRESS: Random key generation is in progress." PT_STATUS_UNSUPPORTED_OEM_NUMBER "PT_STATUS_UNSUPPORTED_OEM_NUMBER: The OEM number specified in the remote control command is not supported by the Intel(R) AMT device." PT_STATUS_UNSUPPORTED_BOOT_OPTION "PT_STATUS_UNSUPPORTED_BOOT_OPTION: The boot option specified in the remote control command is not supported by the Intel(R) AMT device." PT_STATUS_INVALID_COMMAND "PT_STATUS_INVALID_COMMAND: The command specified in the remote control command is not supported by the Intel(R) AMT device." PT_STATUS_INVALID_SPECIAL_COMMAND "PT_STATUS_INVALID_SPECIAL_COMMAND: The special command specified in the remote control command is not supported by the Intel(R) AMT device." PT_STATUS_INVALID_HANDLE "PT_STATUS_INVALID_HANDLE: The handle specified in the command is invalid." PT_STATUS_INVALID_PASSWORD "PT_STATUS_INVALID_PASSWORD: The password specified in the User ACL is invalid." PT_STATUS_INVALID_REALM "PT_STATUS_INVALID_REALM: The realm specified in the User ACL is invalid." PT_STATUS_STORAGE_ACL_ENTRY_IN_USE "PT_STATUS_STORAGE_ACL_ENTRY_IN_USE: The FPACL or EACL entry is used by an active registration and cannot be removed or modified." PT_STATUS_DATA_MISSING "PT_STATUS_DATA_MISSING: Essential data is missing on CommitChanges command." PT_STATUS_DUPLICATE "PT_STATUS_DUPLICATE: The parameter specified is a duplicate of an existing value." PT_STATUS_EVENTLOG_FROZEN "PT_STATUS_EVENTLOG_FROZEN: Event Log operation failed due to the current freeze status of the log." PT_STATUS_PKI_MISSING_KEYS "PT_STATUS_PKI_MISSING_KEYS: The device is missing private key material." PT_STATUS_PKI_GENERATING_KEYS "PT_STATUS_PKI_GENERATING_KEYS: The device is currently generating a keypair. Caller may try repeating this operation at a later time." PT_STATUS_INVALID_KEY "PT_STATUS_INVALID_KEY: An invalid Key was entered." PT_STATUS_INVALID_CERT "PT_STATUS_INVALID_CERT: An invalid X.509 certificate was entered." PT_STATUS_CERT_KEY_NOT_MATCH "PT_STATUS_CERT_KEY_NOT_MATCH: Certificate Chain and Private Key do not match." PT_STATUS_MAX_KERB_DOMAIN_REACHED "PT_STATUS_MAX_KERB_DOMAIN_REACHED: The request cannot be satisfied because the maximum number of allowed Kerberos domains has been reached. (The domain is determined by the first 24 Bytes of the SID.)" PT_STATUS_UNSUPPORTED "PT_STATUS_UNSUPPORTED: The requested configuration is unsupported." PT_STATUS_INVALID_PRIORITY "PT_STATUS_INVALID_PRIORITY: A profile with the requested priority already exists." PT_STATUS_NOT_FOUND "PT_STATUS_NOT_FOUND: Unable to find specified element." PT_STATUS_INVALID_CREDENTIALS "PT_STATUS_INVALID_CREDENTIALS: Invalid User credentials." PT_STATUS_INVALID_PASSPHRASE "PT_STATUS_INVALID_PASSPHRASE: Passphrase is invalid." PT_STATUS_NO_ASSOCIATION "PT_STATUS_NO_ASSOCIATION: A certificate handle must be chosen before the operation can be completed." PTSDK_STATUS_INTERNAL_ERROR "PTSDK_STATUS_INTERNAL_ERROR: The application has identified an internal error." PTSDK_STATUS_NOT_INITIALIZED "PTSDK_STATUS_NOT_INITIALIZED: An ISV operation was called while the library is not initialized." PTSDK_STATUS_LIB_VERSION_UNSUPPORTED "PTSDK_STATUS_LIB_VERSION_UNSUPPORTED: The requested library I/F is not supported by the current library implementation." PTSDK_STATUS_INVALID_PARAM "PTSDK_STATUS_INVALID_PARAM: One of the parameters is invalid (usually indicates a NULL pointer or an invalid session handle is specified)." PTSDK_STATUS_RESOURCES "PTSDK_STATUS_RESOURCES: The SDK could not allocate sufficient resources to complete the operation." PTSDK_STATUS_HARDWARE_ACCESS_ERROR "PTSDK_STATUS_HARDWARE_ACCESS_ERROR: The Library has identified a HW Internal error." PTSDK_STATUS_REQUESTOR_NOT_REGISTERED "PTSDK_STATUS_REQUESTOR_NOT_REGISTERED: The application that sent the request message is not registered. Usually indicates the registration timeout has elapsed. The caller should reregister with the Intel(R) AMT enabled device." PTSDK_STATUS_NETWORK_ERROR "PTSDK_STATUS_NETWORK_ERROR: A network or authentication error has occurred while processing the call." PTSDK_STATUS_PARAM_BUFFER_TOO_SHORT "PTSDK_STATUS_PARAM_BUFFER_TOO_SHORT: Specified container can not hold the requested string." PTSDK_STATUS_COM_NOT_INITIALIZED_IN_THREAD "PTSDK_STATUS_COM_NOT_INITIALIZED_IN_THREAD: ISVS_InitializeCOMinThread was not called by the current thread." PTSDK_STATUS_URL_REQUIRED "PTSDK_STATUS_URL_REQUIRED: URL required." PT_STATUS_RNG_NOT_READY "PT_STATUS_RNG_NOT_READY: A randomly generated key does not exist." PT_STATUS_CERTIFICATE_NOT_READY "PT_STATUS_CERTIFICATE_NOT_READY: Self-generated AMT certificate does not exist." // English (U.S.) resources strings ///////////////////////////////////////////////////////////////////////////// ztc-3.1.0.31/src/Utils.cpp0000644000175000017500000001521010662320062013616 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: Utils.cpp // //---------------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "Utils.h" #include "StringTableUtils.h" #include "StatusCodeDefinitions.h" #include "Options.h" /* * Display a error message */ VOID DisplayErrorMessage(UINT32 errorCode) { TCHAR str[MAX_LINE_LEN]; StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), ERROR_MESSAGE, str, sizeof(str)/sizeof(TCHAR)); fprintf(stderr,"%s ",str); StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), errorCode , str, sizeof(str)/sizeof(TCHAR)); fprintf(stderr, ("%s\n"),str); } /* * Display a status string message */ VOID DisplayStatusString(UINT32 statusStringID) { TCHAR str[MAX_LINE_LEN]; StringTableUtils::LoadStatusString(StringTableUtils::GetModuleHandle(NULL), statusStringID , str, sizeof(str)/sizeof(TCHAR)); fprintf(stdout,"\n%s",str); } /* * Display a message (include \n) */ VOID DisplayMessage(UINT32 messageId) { TCHAR str[MAX_LINE_LEN]; StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), messageId , str, sizeof(str)/sizeof(TCHAR)); fprintf(stdout,"\n%s",str); } /* * Display a String (without \n) */ VOID DisplayString(UINT32 StringId) { TCHAR str[MAX_LINE_LEN]; StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), StringId , str, sizeof(str)/sizeof(TCHAR)); fprintf(stdout,"%s",str); } /* * Calls to Parse user parameters. * Arguments: * param - Local agent parameters structure * Return values: * AMT_STATUS_SUCCESS - on success for get amt configuration data * appropriate error value defined in StatusCodeDefinitions.h - on failure */ UINT32 Parse(int argc, char* argv[],LOCAL_AGENT_PARAMS *Params) { if(NULL == Params|| NULL == argv) return PTSDK_STATUS_INVALID_PARAM; Params->Verbose = false; Params->Activate = false; Params->DnsSuffix.Length = 0; Params->OneTimePassword.Length = 0; char parseKeyDiscovery[MAX_LINE_LEN]; char parseKeyActivate[MAX_LINE_LEN]; char parseKeyOTP[MAX_LINE_LEN]; char parseKeyDnsSuffix[MAX_LINE_LEN]; char parseKeyVerbose[MAX_LINE_LEN]; StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), PARSE_KEYWORD_DISCOVERY_TEST, (TCHAR*)parseKeyDiscovery, sizeof(parseKeyDiscovery)/sizeof(TCHAR)); StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), PARSE_KEYWORD_ACTIVATE, (TCHAR*)parseKeyActivate, sizeof(parseKeyActivate)/sizeof(TCHAR)); StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), PARSE_KEYWORD_OTP, (TCHAR*)parseKeyOTP, sizeof(parseKeyOTP)/sizeof(TCHAR)); StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), PARSE_KEYWORD_DNS, (TCHAR*)parseKeyDnsSuffix, sizeof(parseKeyDnsSuffix)/sizeof(TCHAR)); StringTableUtils::LoadString(StringTableUtils::GetModuleHandle(NULL), PARSE_KEYWORD_VERBOSE, (TCHAR*)parseKeyVerbose, sizeof(parseKeyVerbose)/sizeof(TCHAR)); Options options; const Options::FormatNode format[] = {{parseKeyDiscovery, false}, {parseKeyActivate, false}, {parseKeyOTP, true}, {parseKeyDnsSuffix, true},{parseKeyVerbose, false}}; if (!options.parse(argc, const_cast(argv), format, sizeof(format)/sizeof(Options::FormatNode))) { DisplayErrorMessage(INVALID_PARAM_INPUT); fprintf(stdout,"\n"); return PTSDK_STATUS_INVALID_PARAM; } if(options.optionExists(parseKeyOTP)) { const char* otp = options.getOption(parseKeyOTP); if (strlen(otp) > sizeof(Params->OneTimePassword.String)) { return PTSDK_STATUS_INVALID_PARAM; } Params->OneTimePassword.Length = (UINT16)strlen(otp); memcpy(Params->OneTimePassword.String, otp, Params->OneTimePassword.Length); } if(options.optionExists(parseKeyDnsSuffix)) { const char* dnss = options.getOption(parseKeyDnsSuffix); if (strlen(dnss) > sizeof(Params->DnsSuffix.String)) { return PTSDK_STATUS_INVALID_PARAM; } Params->DnsSuffix.Length = (UINT16)strlen(dnss); memcpy(Params->DnsSuffix.String, dnss, Params->DnsSuffix.Length); } if ((!options.optionExists(parseKeyDiscovery)) && (!options.optionExists(parseKeyActivate))) { return PTSDK_STATUS_INVALID_PARAM; } else if(options.optionExists(parseKeyActivate)) { Params->Activate = true; } else { if(options.optionExists(parseKeyOTP) || options.optionExists(parseKeyDnsSuffix)) { return PTSDK_STATUS_INVALID_PARAM; } } if(options.optionExists(parseKeyVerbose)) { Params->Verbose = true; } return AMT_STATUS_SUCCESS; } /* * Print Usage */ VOID PrintHelp() { DisplayMessage(USAGE); DisplayMessage(USAGE_LOCAL_AGENT); printf("\n"); DisplayMessage(USAGE_OPTIONS); DisplayMessage(USAGE_OPTIONS_DISCOVERY); DisplayMessage(USAGE_OPTIONS_ACTIVATE); DisplayMessage(USAGE_OPTIONS_VERBOSE); DisplayMessage(USAGE_OPTIONS_DNS); DisplayMessage(USAGE_OPTIONS_OTP); DisplayMessage(USAGE_OPTIONS_OTP_SECOND); printf("\n"); } ztc-3.1.0.31/src/StringTableUtils.h0000644000175000017500000000523110662320062015424 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ ///---------------------------------------------------------------------------- // // File: StringTableUtils->h // // Contents: header file of StringTableUtils // //---------------------------------------------------------------------------- #ifndef STRING_TABLE_UTILS_H #define STRING_TABLE_UTILS_H #include #include #include using namespace std; class StringTableUtils { public: /* * function prototypes */ static DWORD GetLastError(void); static void DisplayError(DWORD LastError); static BOOL StringTableInit(char *dat_filename,BOOL isStatus); static int LoadString(LPVOID Instance, UINT Id, TCHAR *Buffer, UINT BufferMax); static int LoadStatusString(LPVOID Instance, UINT Id, TCHAR *Buffer, UINT BufferMax); static LPVOID GetModuleHandle(LPSTR Dummy); private: static map _stringTableMap; static map _statusStringMap; }; #endif ztc-3.1.0.31/src/Makefile.in0000644000175000017500000003472610662320061014073 0ustar kylekyle# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 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@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ 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 = : ztcbin_PROGRAMS = ZTCLocalAgent$(EXEEXT) subdir = src DIST_COMMON = $(dist_noinst_DATA) $(dist_noinst_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(ztcbindir)" "$(DESTDIR)$(ztcbindir)" ztcbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(ztcbin_PROGRAMS) am_ZTCLocalAgent_OBJECTS = ZTCLocalAgent.$(OBJEXT) \ PTHICommand.$(OBJEXT) HECILinux.$(OBJEXT) Utils.$(OBJEXT) \ Options.$(OBJEXT) StringTableUtils.$(OBJEXT) ZTCLocalAgent_OBJECTS = $(am_ZTCLocalAgent_OBJECTS) ZTCLocalAgent_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ SOURCES = $(ZTCLocalAgent_SOURCES) DIST_SOURCES = $(ZTCLocalAgent_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; ztcbinDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_noinst_DATA) $(ztcbin_DATA) HEADERS = $(dist_noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ 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_alias = @build_alias@ datadir = @datadir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ ztcbindir = ${prefix}/intel/ZTCLocalAgent ZTCLocalAgent_SOURCES = ZTCLocalAgent.cpp \ PTHICommand.cpp HECILinux.cpp \ Utils.cpp Options.cpp \ StringTableUtils.cpp dist_noinst_HEADERS = ZTCLocalAgent.h \ heci.h HECI_if.h HECILinux.h PTHICommand.h WD_if.h \ Options.h Utils.h \ Types.h resource.h version.h \ StatusCodeDefinitions.h StringTableUtils.h RSC_SRCS = ZTCLocalAgent.str \ StatusStrings.str RSC_OBJS = $(RSC_SRCS:.str=.dat) dist_noinst_DATA = $(RSC_SRCS) ztcbin_DATA = $(RSC_OBJS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/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 install-ztcbinPROGRAMS: $(ztcbin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(ztcbindir)" || $(mkdir_p) "$(DESTDIR)$(ztcbindir)" @list='$(ztcbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(ztcbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(ztcbindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(ztcbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(ztcbindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-ztcbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(ztcbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(ztcbindir)/$$f'"; \ rm -f "$(DESTDIR)$(ztcbindir)/$$f"; \ done clean-ztcbinPROGRAMS: -test -z "$(ztcbin_PROGRAMS)" || rm -f $(ztcbin_PROGRAMS) ZTCLocalAgent$(EXEEXT): $(ZTCLocalAgent_OBJECTS) $(ZTCLocalAgent_DEPENDENCIES) @rm -f ZTCLocalAgent$(EXEEXT) $(CXXLINK) $(ZTCLocalAgent_LDFLAGS) $(ZTCLocalAgent_OBJECTS) $(ZTCLocalAgent_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HECILinux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PTHICommand.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringTableUtils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ZTCLocalAgent.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: install-ztcbinDATA: $(ztcbin_DATA) @$(NORMAL_INSTALL) test -z "$(ztcbindir)" || $(mkdir_p) "$(DESTDIR)$(ztcbindir)" @list='$(ztcbin_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(ztcbinDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(ztcbindir)/$$f'"; \ $(ztcbinDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(ztcbindir)/$$f"; \ done uninstall-ztcbinDATA: @$(NORMAL_UNINSTALL) @list='$(ztcbin_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(ztcbindir)/$$f'"; \ rm -f "$(DESTDIR)$(ztcbindir)/$$f"; \ done 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; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here 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)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$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 $(PROGRAMS) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(ztcbindir)" "$(DESTDIR)$(ztcbindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-local clean-ztcbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-ztcbinDATA install-ztcbinPROGRAMS install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am uninstall-ztcbinDATA \ uninstall-ztcbinPROGRAMS .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-local clean-ztcbinPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ install-ztcbinDATA install-ztcbinPROGRAMS installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am uninstall-ztcbinDATA \ uninstall-ztcbinPROGRAMS %.dat: %.str $(CPP) -x c++ -I. $< >$@ clean-local: rm -f $(RSC_OBJS) # 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: ztc-3.1.0.31/src/ZTCLocalAgent.str0000644000175000017500000001442210662320062015142 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #include "resource.h" ///////////////////////////////////////////////////////////////////////////// //String Table USAGE "Usage:" ERROR_MESSAGE "Error: " VERSION_MESSAGE "Intel(R) ZTCLocalAgent Version: " HECI_ERROR_MESSAGE "HECI Error: " UNKNOWN "Unknown" HECI_CONNECT_TO_FWU_CLIENT_FAILURE "Failed to connect to HECI FW Update client" WRITE_FILE_TIME_OUT "WriteFile timed out" ME_FW_INFO "ME FW Info\n" ME_MODE "SKU:" IOCTL_COMMAND "I/O control command" WRITE_FILE "WriteFile " READ_FILE "ReadFile" GET_CLASS_DEVS "SetupDiGetClassDevs " GET_INTERFACE_DETAIL "Get interface detail" ICH_VERSION "ICH Version:" FIND_HECI_FAILURE "Cannot find HECI device." CREATE_HECI_FILE_FAILURE "Cannot establish a handle to the HECI driver." GET_HECI_DRIVER_VERSION_FAILURE "Failed to get HECI driver version." LA_STATUS_INTERNAL_ERROR "An internal error has occurred." HECI_CONNECT_TO_PTHI_CLIENT_FAILURE "Failed to connect to HECI PTHI client." LA_HECI_ERROR "A HECI error has occurred." ALLOCATE_MEMORY_ERROR "Memory Allocation Error" LA_HECI_NOT_INSTALLED_ERROR "HECI driver is not installed." FW_BUFFER_IS_TO_SMALL "FW supported buffer size is too small." SEND_DATA_TO_FW_FAILURE "Failed to send data to FW." RECEIVE_DATA_FROM_FW_FAILURE "Failed to receive data from FW." GET_INFO_FROM_HECI_FAILURE "Cannot get info from HECI FW update client." MCH_VERSION "MCH Version:" OEM_VENDOR "OEM Vendor:" HECI_DRIVER_VERSION "Connected to HECI driver, version:" CODE_MAJOR_VERSION "Code Major Version:" CODE_MINOR_VERSION "Code Minor Version:" CODE_HOTFIX_VERSION "Code Hotfix Version:" CODE_BUID_VERSION "Code Build Version:" BIOS_VERSION "BIOS Version:" AMT_CODE_VERSION "Intel(R) AMT code versions:" AMT_MODE "Intel AMT Mode: " AMT_MODE_1 "1.0" AMT_MODE_2 "2.0" PROVISIONING_STATE "Setup and Configuration: " STATE_PRE "Not started" STATE_IN "In process" STATE_POST "Completed" PARSE_KEYWORD_DISCOVERY_TEST "discovery" DISCOVERY_PASS "Discovery test passed for activate configuration" DISCOVERY_FAILED "Discovery test failed for activate configuration" PARSE_KEYWORD_ACTIVATE "activate" PARSE_KEYWORD_OTP "otp" PARSE_KEYWORD_DNS "dns" PARSE_KEYWORD_VERBOSE "verbose" INVALID_PARAM_INPUT "invalid parameter was found." USAGE_LOCAL_AGENT "ZTCLocalAgent.exe <-discovery|-activate [-otp ] [-dns ]> [-verbose]" USAGE_OPTIONS "where options:" USAGE_OPTIONS_OTP " otp -One time password needed for PKI provisioning" USAGE_OPTIONS_OTP_SECOND " (password length must be between 8-32 bytes)." USAGE_OPTIONS_DNS " dns -DNS suffix of configuration server." USAGE_OPTIONS_DISCOVERY " discovery -Perform discovery test on the AMT system." USAGE_OPTIONS_ACTIVATE " activate -Start setup and configuration on the AMT system." USAGE_OPTIONS_VERBOSE " verbose -Outputs debug information." WORD_ZTC "Zero Touch Configuration:" WORD_ENABLED "enabled" WORD_DISABLED "disabled" WORD_PROVISIONING_TLS_MODE "Provisioning TLS Mode:" WORD_PKI "PKI" WORD_PSK "PSK" WORD_RNG_SEED_STATUS "RNG seed status:" WORD_EXIST "exists" WORD_IN_PROGRESS "in progress" WORD_NOT_EXIST "does not exist" WORD_AMT_CONFIG_ACTIVATE "Activate Intel AMT configuration:" WORD_SUCCESS "success" WORD_FAILURE "failure" WORD_NOT_READY "NOT READY" HASH_ENTRY "Certificate hash entry:" HECI_CONNECT_TO_WD_CLIENT_FAILURE "Failed to connect to HECI WD client." CHANGE_TO_AMT_FAILURE "Changing to Intel AMT mode is not allowed." WORD_CHANGE_TO_AMT "Change to Intel AMT mode:" FOUND "Found" CERT_HASHES_IN_FW "certificate hashes in following Handles:" NO_HANDLES_FOUND "No Handles were found." CERT_HASH "Certificate Hash:" FRIENDLY_NAME "Friendly Name = " // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// ztc-3.1.0.31/src/Options.h0000644000175000017500000001221510662320061013617 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: Options.h // // Notes: This file contains the definition of a generic class for command line options // parsing. // //---------------------------------------------------------------------------- #ifndef _OPTIONS_H #define _OPTIONS_H #include /* Options is a generic class for parsing command line arguments. The command line is expected to be of the form: progname.exe -opt1 val1 -opt2 val2... where opt1 is the option name, and val1 is the value for this option. The option names are specified in advance, and the ones specified are the only valid ones: any other option name is considered an error. The values of the parameters are optional, but it must be specified in advance whether each parameter has a value. Any other parameter in the command line, that doesn't start with '-' is ignored, and would not cause errors. */ class Options { private: //internal function object for comparing strings in map (case insensitive) struct StrLess { bool operator()(const char* left, const char* right) const; }; public: //One node in the format list of the options. struct FormatNode { const char* option; //Name of option bool bHasParam; //Indication whether this option has a parameter }; //class that represents the entire format of the options. class Format { public: //ctor to build Format from a list of FormatNode's Format(const FormatNode rawFormat[], int rawFormatSize); //default ctor Format(); //Add one option to the format, with option name and parameter indication. void addOption(const char* option, bool bHasParam); //returns true iff a certain option exists in the format. bool optionExists(const char *option) const; //returns true iff a certain option has a prameter indicated by the format. bool optionHasParam(const char* option) const; private: typedef std::map FormatMap; //Map that holds the association between option name and parameter indication. FormatMap m_formatMap; }; //ctor to build Options by parsing a command line, with a given Format object. Options(int argc, const char* argv[], const Format &format); //ctor to build Options by parsing a command line, with a given array of FormatNode's Options(int argc, const char* argv[], const FormatNode rawFormat[], int rawFormatSize); //default ctor. parse() should be used when using it. Options(); //return the value of a given option. //Returns NULL if option doesn't exist, "" if option has no value. const char* getOption(const char* option) const; //returns true iff a certain option exists in the Options object. bool optionExists(const char* option) const; //returns true iff parse was called - either directly or by a ctor. //Will return false if parsing wasn't done or if it failed. bool isParsed() const {return m_parsed;} //parse a command line according to Format object, and store results in this Options object. bool parse(int argc, const char* argv[], const Format &format); //parse a command line according to array of FormatNode's, and store results in this //Options object. bool parse(int argc, const char* argv[], const FormatNode rawFormat[], int rawFormatSize); private: typedef std::map OptionsMap; OptionsMap m_optionsMap; //map that associates option names with their values. bool m_parsed; //was parse() called }; #endif //#ifndef _OPTIONS_H ztc-3.1.0.31/src/HECILinux.cpp0000644000175000017500000001452510662320061014255 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include "HECILinux.h" #pragma pack(1) typedef struct heci_ioctl_data{ uint32_t size; char* data; }heci_ioctl_data_t; /* IOCTL commands */ #define HECI_IOCTL_LETTER 'H' #define IOCTL_HECI_GET_VERSION \ _IOWR(HECI_IOCTL_LETTER ,0x800,heci_ioctl_data_t) #define IOCTL_HECI_CONNECT_CLIENT \ _IOWR(HECI_IOCTL_LETTER ,0x801, heci_ioctl_data_t) #define IOCTL_HECI_WD \ _IOWR(HECI_IOCTL_LETTER ,0x802, heci_ioctl_data_t) #define IAMT_HECI_GET_RECEIVED_MESSAGE_DATA \ _IOW(HECI_IOCTL_LETTER, 0x803, heci_ioctl_data_t) typedef struct heci_client { uint32_t max_message_length; uint8_t protocol_version; } heci_client_t; typedef struct heci_driver_version { uint8_t major; uint8_t minor; uint8_t hotfix; uint16_t build; } heci_driver_version_t; #pragma pack(0) /***************************** public functions *****************************/ HECILinux::HECILinux(const GUID guid, bool verbose): HECI(guid, verbose) { } HECILinux::~HECILinux() { if (_fd != -1) { close(_fd); } } bool HECILinux::Init() { int result; heci_driver_version_t *version; heci_client_t *heci_client; bool return_result = true; heci_ioctl_data_t version_response; heci_ioctl_data_t client_connect; if (_initialized) { Deinit(); } _fd = open("/dev/heci", O_RDWR); if (_fd == -1 ) { if (_verbose) { fprintf(stderr, "Error: Cannot establish a handle to the HECI driver\n"); } return false; } _initialized = true; version_response.size = sizeof(heci_driver_version_t); version_response.data = (char*)malloc(version_response.size); if (!version_response.data) { printf("malloc failure.\n"); return_result = false; Deinit(); goto heci_free; } result = ioctl(_fd, IOCTL_HECI_GET_VERSION, &version_response); if (result) { if (_verbose) { fprintf(stderr, "error in IOCTL_HECI_GET_VERSION recieve message. err=%d\n",result); } return_result = false; Deinit(); goto heci_free; } version =(heci_driver_version_t*)version_response.data; if (_verbose) { printf("Connected to HECI driver, version: %d.%d.%d.%d\n", version->major, version->minor, version->hotfix, version->build); printf("Size of guid = %d\n",sizeof(_guid)); } client_connect.size = sizeof(_guid); client_connect.data = (char*)malloc(client_connect.size); if (!client_connect.data) { printf("malloc failure.\n"); return_result = false; Deinit(); goto heci_free; } memcpy(client_connect.data,&_guid,sizeof(_guid)); result = ioctl(_fd, IOCTL_HECI_CONNECT_CLIENT, &client_connect); if (result) { if (_verbose) { fprintf(stderr, "error in IOCTL_HECI_CONNECT_CLIENT recieve message. err=%d\n",result); } return_result = false; Deinit(); goto heci_free; } heci_client = (heci_client_t*) client_connect.data; if (_verbose) { printf("max_message_length %d \n",(heci_client->max_message_length)); printf("protocol_version %d \n",(heci_client->protocol_version)); } _bufSize =heci_client->max_message_length; heci_free: if(NULL!=version_response.data) free(version_response.data); if(NULL!=client_connect.data) free(client_connect.data); return return_result; } void HECILinux::Deinit() { if (_fd != -1) { close(_fd); _fd = -1; } _bufSize = 0; _initialized = false; } int HECILinux::ReceiveMessage(unsigned char *buffer, int len, unsigned long timeout) { int rv = 0; rv = read(_fd,(void*)buffer,len); if (rv < 0) { if (_verbose) { fprintf(stderr,"read failed with status %d\n", rv); } Deinit(); } return rv; } int HECILinux::SendMessage(unsigned char *buffer, int len, unsigned long timeout) { int rv = 0; int return_length =0; fd_set set; struct timeval tv; tv.tv_sec = timeout / 1000; tv.tv_usec =(timeout % 1000) * 1000000; if (_verbose) { printf("call write length = %d\n",len); } return_length = write( _fd,(void *)buffer,len); if ( return_length < 0) { if (_verbose) { fprintf(stderr,"write failed with status %d\n", rv); } goto out; } FD_ZERO(&set); FD_SET(_fd, &set); rv = select(_fd+1 ,&set,NULL, NULL, &tv); if (rv > 0 && FD_ISSET(_fd, &set)) { if (_verbose) { fprintf(stderr,"write success\n"); } } else if (rv == 0) { if (_verbose) { fprintf(stderr,"write failed on timeout with status\n"); goto out; } } else { //rv<0 if (_verbose) { fprintf(stderr,"write failed on select with status %d\n", rv); goto out; } } rv = return_length; out: if (rv < 0) { printf("Send failed!\n"); Deinit(); } return rv; } int HECILinux::GetHandle() { return _fd; } ztc-3.1.0.31/src/Makefile.am0000644000175000017500000000111310662320061014042 0ustar kylekyle ztcbindir=${prefix}/intel/ZTCLocalAgent ztcbin_PROGRAMS=ZTCLocalAgent ZTCLocalAgent_SOURCES=ZTCLocalAgent.cpp \ PTHICommand.cpp HECILinux.cpp \ Utils.cpp Options.cpp \ StringTableUtils.cpp dist_noinst_HEADERS=ZTCLocalAgent.h \ heci.h HECI_if.h HECILinux.h PTHICommand.h WD_if.h \ Options.h Utils.h \ Types.h resource.h version.h \ StatusCodeDefinitions.h StringTableUtils.h RSC_SRCS=ZTCLocalAgent.str \ StatusStrings.str RSC_OBJS = $(RSC_SRCS:.str=.dat) dist_noinst_DATA=$(RSC_SRCS) ztcbin_DATA=$(RSC_OBJS) %.dat: %.str $(CPP) -x c++ -I. $< >$@ clean-local: rm -f $(RSC_OBJS) ztc-3.1.0.31/src/PTHICommand.h0000644000175000017500000004330010662320062014227 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: PTHIcommand->h // // Contents: header file of PTHICommand class // //---------------------------------------------------------------------------- #ifndef __PTHI_COMMAND_H__ #define __PTHI_COMMAND_H__ #include "HECILinux.h" #define CERT_HASH_MAX_LENGTH 64 #define CERT_HASH_MAX_NUMBER 23 #define NET_TLS_CERT_PKI_MAX_SERIAL_NUMS 3 #define NET_TLS_CERT_PKI_MAX_SERIAL_NUM_LENGTH 16 /* * Type definitions */ typedef char CHAR; typedef unsigned char UINT8; typedef unsigned short UINT16; typedef unsigned int UINT32; typedef unsigned long ULONG; typedef UINT32 AMT_BOOLEAN; typedef UINT32 AMT_STATUS; typedef UINT32 CFG_PROVISIONING_MODE; typedef enum _AMT_PROVISIONING_MODE { PROVISIONING_MODE_NONE =0, PROVISIONING_MODE_ENTERPRISE, PROVISIONING_MODE_SMB }AMT_PROVISIONING_MODE; typedef enum _AMT_PROVISIONING_TLS_MODE { NOT_READY = 0, PSK = 1, PKI = 2 } AMT_PROVISIONING_TLS_MODE; typedef enum _AMT_PROVISIONING_STATE { PROVISIONING_STATE_PRE = 0, PROVISIONING_STATE_IN = 1, PROVISIONING_STATE_POST = 2 } AMT_PROVISIONING_STATE; typedef enum _AMT_RNG_STATUS { RNG_STATUS_EXIST = 0, RNG_STATUS_IN_PROGRESS = 1, RNG_STATUS_NOT_EXIST = 2 } AMT_RNG_STATUS; static const UINT32 BIOS_VERSION_LEN = 65; static const UINT32 VERSIONS_NUMBER = 50; static const UINT32 UNICODE_STRING_LEN = 20; #pragma pack (1) typedef struct _AMT_UNICODE_STRING { UINT16 Length; UINT8 String[UNICODE_STRING_LEN]; } AMT_UNICODE_STRING; typedef struct _AMT_VERSION_TYPE { AMT_UNICODE_STRING Description; AMT_UNICODE_STRING Version; }AMT_VERSION_TYPE; typedef struct _PTHI_VERSION { UINT8 MajorNumber; UINT8 MinorNumber; } PTHI_VERSION; typedef struct _CODE_VERSIONS { UINT8 BiosVersion[BIOS_VERSION_LEN]; UINT32 VersionsCount; AMT_VERSION_TYPE Versions[VERSIONS_NUMBER]; } CODE_VERSIONS; typedef struct _COMMAND_FMT { union { UINT32 val; struct { UINT32 Operation : 23; UINT32 IsResponse : 1; UINT32 Class : 8; } fields; } cmd; } COMMAND_FMT; typedef struct _AMT_HASH_HANDLES { UINT32 Length; UINT32 Handles[CERT_HASH_MAX_NUMBER]; }AMT_HASH_HANDLES; typedef struct _AMT_ANSI_STRING { UINT16 Length; CHAR* Buffer; }AMT_ANSI_STRING; typedef struct _CERTHASH_ENTRY { AMT_BOOLEAN IsDefault; AMT_BOOLEAN IsActive; UINT8 CertificateHash[CERT_HASH_MAX_LENGTH]; UINT8 HashAlgorithm; AMT_ANSI_STRING Name; }CERTHASH_ENTRY; typedef struct _PTHI_MESSAGE_HEADER { PTHI_VERSION Version; UINT16 Reserved; COMMAND_FMT Command; UINT32 Length; } PTHI_MESSAGE_HEADER; typedef enum { CERT_HASH_ALGORITHM_MD5 = 0, // 16 bytes CERT_HASH_ALGORITHM_SHA1, // 20 bytes CERT_HASH_ALGORITHM_SHA256, // 32 bytes CERT_HASH_ALGORITHM_SHA512, // 64 bytes } CERT_HASH_ALGORITHM; typedef struct { UINT16 Year; UINT16 Month; UINT16 DayOfWeek; UINT16 Day; UINT16 Hour; UINT16 Minute; UINT16 Second; } TIME_DATE; typedef struct _AMT_PROV_AUDIT_RECORD { UINT8 ProvisioningTLSMode; AMT_BOOLEAN SecureDNS; AMT_BOOLEAN HostInitiated; CERT_HASH_ALGORITHM SelectedHashType; UINT8 SelectedHashData[CERT_HASH_MAX_LENGTH]; UINT8 CaCertificateSerials[NET_TLS_CERT_PKI_MAX_SERIAL_NUMS*NET_TLS_CERT_PKI_MAX_SERIAL_NUM_LENGTH]; AMT_BOOLEAN AdditionalCaSerialNums; AMT_BOOLEAN IsOemDefault; AMT_BOOLEAN IsTimeValid; UINT32 ProvServerIP; TIME_DATE TlsStartTime; AMT_ANSI_STRING ProvServerFQDN; }AMT_PROV_AUDIT_RECORD; typedef struct _CFG_GET_CODE_VERSIONS_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; CODE_VERSIONS CodeVersions; } CFG_GET_CODE_VERSIONS_RESPONSE; typedef struct _CFG_GET_PROVISIONING_MODE_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; CFG_PROVISIONING_MODE ProvisioningMode; AMT_BOOLEAN LegacyMode; } CFG_GET_PROVISIONING_MODE_RESPONSE; typedef struct _CFG_GET_PROVISIONING_STATE_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_PROVISIONING_STATE ProvisioningState; } CFG_GET_PROVISIONING_STATE_RESPONSE; typedef struct _CFG_GENERATE_RNG_SEED_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_GENERATE_RNG_SEED_RESPONSE; typedef struct _CFG_GET_RNG_SEED_STATUS_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_RNG_STATUS RngStatus; } CFG_GET_RNG_SEED_STATUS_RESPONSE; typedef struct _CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_BOOLEAN ZeroTouchEnabled; } CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE; typedef struct _CFG_GET_PROVISIONING_TLS_MODE_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_PROVISIONING_TLS_MODE ProvisioningTlsMode; } CFG_GET_PROVISIONING_TLS_MODE_RESPONSE; typedef struct _CFG_START_CONFIGURATION_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_START_CONFIGURATION_RESPONSE; typedef struct _CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE; typedef struct _CFG_SET_DNS_SUFFIX_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_SET_DNS_SUFFIX_RESPONSE; typedef struct _CFG_GET_HASH_HANDLES_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_HASH_HANDLES HashHandles; } CFG_GET_HASH_HANDLES_RESPONSE; typedef struct _CFG_GET_CERTHASH_ENTRY_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; CERTHASH_ENTRY Hash; } CFG_GET_CERTHASH_ENTRY_RESPONSE; typedef struct _CFG_GET_PKI_FQDN_SUFFIX_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_ANSI_STRING Suffix; } CFG_GET_PKI_FQDN_SUFFIX_RESPONSE; typedef struct _CFG_GET_AUDIT_RECORD_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_PROV_AUDIT_RECORD AuditRecord; } CFG_GET_AUDIT_RECORD_RESPONSE; typedef struct _CFG_GET_PID_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; UINT8 PID[8]; } CFG_GET_PID_RESPONSE; typedef struct _CFG_SET_CONF_SERVER_FQDN_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_SET_CONF_SERVER_FQDN_RESPONSE; typedef struct _CFG_GET_CONF_SERVER_FQDN_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; AMT_ANSI_STRING FQDN; } CFG_GET_CONF_SERVER_FQDN_RESPONSE; typedef struct _CFG_SET_CERTHASH_STATE_REQUEST { PTHI_MESSAGE_HEADER Header; UINT32 Handle; AMT_BOOLEAN IsActive; } CFG_SET_CERTHASH_STATE_REQUEST; typedef struct _CFG_SET_CERTHASH_STATE_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_SET_CERTHASH_STATE_RESPONSE; typedef struct _CFG_ADD_CERTHASH_ENTRY_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; UINT32 Handle; } CFG_ADD_CERTHASH_ENTRY_RESPONSE; typedef struct _CFG_DELETE_CERTHASH_ENTRY_REQUEST { PTHI_MESSAGE_HEADER Header; UINT32 Handle; } CFG_DELETE_CERTHASH_ENTRY_REQUEST; typedef struct _CFG_DELETE_CERTHASH_ENTRY_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_DELETE_CERTHASH_ENTRY_RESPONSE; typedef struct _CFG_SET_ZTC_MODE_REQUEST { PTHI_MESSAGE_HEADER Header; AMT_BOOLEAN Mode; } CFG_SET_ZTC_MODE_REQUEST; typedef struct _CFG_SET_ZTC_MODE_RESPONSE { PTHI_MESSAGE_HEADER Header; AMT_STATUS Status; } CFG_SET_ZTC_MODE_RESPONSE; #pragma pack ( ) class PTHICommand { public: PTHICommand(bool verbose = false); ~PTHICommand(); AMT_STATUS GetCodeVersions(CODE_VERSIONS *CodeVersions); VOID DisplayCodeVersions(const CODE_VERSIONS *versions); AMT_STATUS GetProvisioningMode(AMT_BOOLEAN *legacy,CFG_PROVISIONING_MODE *mode); VOID DisplayAMTMode(const AMT_BOOLEAN *legacy); AMT_STATUS GetProvisioningState(AMT_PROVISIONING_STATE *state); VOID DisplayProvisioningState(const AMT_PROVISIONING_STATE *state); AMT_STATUS GenerateRngKey(); AMT_STATUS GetRngSeedStatus(AMT_RNG_STATUS *rngStatus); VOID DisplayRngSeedStatus(const AMT_RNG_STATUS *rngStatus); AMT_STATUS GetZeroTouchEnabled(AMT_BOOLEAN *zeroTouchEnabled); VOID DisplayZTCEnabled(const AMT_BOOLEAN *ztcEnabled); AMT_STATUS GetProvisioningTlsMode(AMT_PROVISIONING_TLS_MODE *provisioningTlsMode); VOID DisplayProvisioningTlsMode(const AMT_PROVISIONING_TLS_MODE *provisioningTlsMode); AMT_STATUS StartConfiguration(); AMT_STATUS SetProvisioningServerOTP(AMT_ANSI_STRING passwordOTP); AMT_STATUS SetDnsSuffix(AMT_ANSI_STRING dnsSuffix); AMT_STATUS EnumerateHashHandles(AMT_HASH_HANDLES *hashHandles); AMT_STATUS GetCertificateHashEntry(UINT32 hashHandle, CERTHASH_ENTRY *hashEntry); AMT_STATUS GetDnsSuffix(AMT_ANSI_STRING *dnsSuffix); AMT_STATUS GetAMTSetupAuditRecord(AMT_PROV_AUDIT_RECORD *auditRecord); VOID DisplayHashEntry(CERTHASH_ENTRY hashEntry); AMT_STATUS GetPID(UINT8 *pid); AMT_STATUS SetConfServerFQDN(AMT_ANSI_STRING confServerFQDN); AMT_STATUS GetConfServerFQDN(AMT_ANSI_STRING *confServerFQDN); AMT_STATUS SetCertificateHashState(UINT32 handle , AMT_BOOLEAN isActive ); AMT_STATUS AddCertificateHashEntry( AMT_BOOLEAN isDefault, AMT_BOOLEAN isActive, UINT8 certificateHash[20], AMT_ANSI_STRING name , UINT32 *handle); AMT_STATUS DeleteCustomizedCertificateHashEntry(UINT32 handle); AMT_STATUS SetZeroTouchEnabled( AMT_BOOLEAN mode ); HECILinux PTHIClient; private: AMT_STATUS _verifyResponseHeader(const UINT32 command,const PTHI_MESSAGE_HEADER *response_header,UINT32 response_size); AMT_STATUS _verifyProvisioningState(const CFG_GET_PROVISIONING_STATE_RESPONSE *response); AMT_STATUS _verifyProvisioningMode(const CFG_GET_PROVISIONING_MODE_RESPONSE *response); AMT_STATUS _verifyCodeVersions(const CFG_GET_CODE_VERSIONS_RESPONSE *response); AMT_STATUS _verifyGenerateRngKey(const CFG_GENERATE_RNG_SEED_RESPONSE *response); AMT_STATUS _verifyGetRngSeedStatus(const CFG_GET_RNG_SEED_STATUS_RESPONSE *response); AMT_STATUS _verifyGetZeroTouchEnabled(const CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE *response); AMT_STATUS _verifyGetProvisioningTlsMode(const CFG_GET_PROVISIONING_TLS_MODE_RESPONSE *response); AMT_STATUS _verifyStartConfiguration(const CFG_START_CONFIGURATION_RESPONSE *response); AMT_STATUS _verifySetProvisioningServerOTP(const CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE *response); AMT_STATUS _verifySetDnsSuffix(const CFG_SET_DNS_SUFFIX_RESPONSE *response); AMT_STATUS _verifyHashHandles(const CFG_GET_HASH_HANDLES_RESPONSE *response); AMT_STATUS _verifyGetCertificateHashEntry(const CFG_GET_CERTHASH_ENTRY_RESPONSE *response); AMT_STATUS _verifyGetDnsSuffix(const CFG_GET_PKI_FQDN_SUFFIX_RESPONSE *response); AMT_STATUS _verifyGetAMTSetupAuditRecord(const CFG_GET_AUDIT_RECORD_RESPONSE *response); AMT_STATUS _verifyGetPID(const CFG_GET_PID_RESPONSE *response); AMT_STATUS _verifySetConfServerFQDN(const CFG_SET_CONF_SERVER_FQDN_RESPONSE *response); AMT_STATUS _verifyGetConfServerFQDN(const CFG_GET_CONF_SERVER_FQDN_RESPONSE *response); AMT_STATUS _verifySetCertificateHashState(const CFG_SET_CERTHASH_STATE_RESPONSE *response); AMT_STATUS _verifyAddCertificateHashEntry(const CFG_ADD_CERTHASH_ENTRY_RESPONSE *response); AMT_STATUS _verifyDeleteCertificateHashEntry(const CFG_DELETE_CERTHASH_ENTRY_RESPONSE *response); AMT_STATUS _verifySetZeroTouchEnabled(const CFG_SET_ZTC_MODE_RESPONSE *response); }; /* * Constants */ const UINT8 AMT_MAJOR_VERSION = 1; const UINT8 AMT_MINOR_VERSION = 1; const UINT32 CODE_VERSIONS_REQUEST = 0x0400001A; const UINT32 CODE_VERSIONS_RESPONSE = 0x0480001A; const PTHI_MESSAGE_HEADER GET_CODE_VERSION_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{CODE_VERSIONS_REQUEST},0 }; const UINT32 PROVISIONING_MODE_REQUEST = 0x04000008; const UINT32 PROVISIONING_MODE_RESPONSE = 0x04800008; const PTHI_MESSAGE_HEADER GET_PROVISIONING_MODE_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{PROVISIONING_MODE_REQUEST},0 }; const UINT32 PROVISIONING_STATE_REQUEST = 0x04000011; const UINT32 PROVISIONING_STATE_RESPONSE = 0x04800011; const PTHI_MESSAGE_HEADER GET_PROVISIONING_STATE_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{PROVISIONING_STATE_REQUEST},0 }; const UINT32 GENERATE_RNG_SEED_REQUEST = 0x04000028; const UINT32 GENERATE_RNG_SEED_RESPONSE = 0x04800028; const PTHI_MESSAGE_HEADER GENERATE_RNG_SEED_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GENERATE_RNG_SEED_REQUEST},0 }; const UINT32 GET_RNG_SEED_STATUS_REQUEST = 0x0400002E; const UINT32 GET_RNG_SEED_STATUS_RESPONSE = 0x0480002E; const PTHI_MESSAGE_HEADER GET_RNG_SEED_STATUS_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_RNG_SEED_STATUS_REQUEST},0 }; const UINT32 GET_ZERO_TOUCH_ENABLED_REQUEST = 0x04000030; const UINT32 GET_ZERO_TOUCH_ENABLED_RESPONSE = 0x04800030; const PTHI_MESSAGE_HEADER GET_ZERO_TOUCH_ENABLED_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_ZERO_TOUCH_ENABLED_REQUEST},0 }; const UINT32 GET_PROVISIONING_TLS_MODE_REQUEST = 0x0400002B; const UINT32 GET_PROVISIONING_TLS_MODE_RESPONSE = 0x0480002B; const PTHI_MESSAGE_HEADER GET_PROVISIONING_TLS_MODE_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_PROVISIONING_TLS_MODE_REQUEST},0 }; const UINT32 START_CONFIGURATION_REQUEST = 0x04000029; const UINT32 START_CONFIGURATION_RESPONSE = 0x04800029; const PTHI_MESSAGE_HEADER START_CONFIGURATION_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{START_CONFIGURATION_REQUEST},0 }; const UINT32 SET_PROVISIONING_SERVER_OTP_REQUEST = 0x0400002A; const UINT32 SET_PROVISIONING_SERVER_OTP_RESPONSE = 0x0480002A; const UINT32 SET_DNS_SUFFIX_REQUEST = 0x0400002F; const UINT32 SET_DNS_SUFFIX_RESPONSE = 0x0480002F; const UINT32 ENUMERATE_HASH_HANDLES_REQUEST = 0x0400002C; const UINT32 ENUMERATE_HASH_HANDLES_RESPONSE = 0x0480002C; const PTHI_MESSAGE_HEADER ENUMERATE_HASH_HANDLES_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{ENUMERATE_HASH_HANDLES_REQUEST},0 }; const UINT32 GET_CERTHASH_ENTRY_REQUEST = 0x0400002D; const UINT32 GET_CERTHASH_ENTRY_RESPONSE = 0x0480002D; const UINT32 GET_PKI_FQDN_SUFFIX_REQUEST = 0x04000036; const UINT32 GET_PKI_FQDN_SUFFIX_RESPONSE = 0x04800036; const PTHI_MESSAGE_HEADER GET_PKI_FQDN_SUFFIX_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_PKI_FQDN_SUFFIX_REQUEST},0 }; const UINT32 GET_AUDIT_RECORD_REQUEST = 0x04000027; const UINT32 GET_AUDIT_RECORD_RESPONSE = 0x04800027; const PTHI_MESSAGE_HEADER GET_AUDIT_RECORD_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_AUDIT_RECORD_REQUEST},0 }; const UINT32 GET_PID_REQUEST = 0x0400003B; const UINT32 GET_PID_RESPONSE = 0x0480003B; const PTHI_MESSAGE_HEADER GET_PID_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_PID_REQUEST},0 }; const UINT32 SET_CONF_SERVER_FQDN_REQUEST = 0x04000034; const UINT32 SET_CONF_SERVER_FQDN_RESPONSE = 0x04800034; const UINT32 GET_CONF_SERVER_FQDN_REQUEST = 0x04000033; const UINT32 GET_CONF_SERVER_FQDN_RESPONSE = 0x04800033; const PTHI_MESSAGE_HEADER GET_CONF_SERVER_FQDN_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_CONF_SERVER_FQDN_REQUEST},0 }; const UINT32 SET_CERTHASH_STATE_REQUEST = 0x04000037; const UINT32 SET_CERTHASH_STATE_RESPONSE = 0x04800037; const PTHI_MESSAGE_HEADER SET_CERTHASH_STATE_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{SET_CERTHASH_STATE_REQUEST},sizeof(CFG_SET_CERTHASH_STATE_REQUEST) }; const UINT32 ADD_CERTHASH_ENTRY_REQUEST = 0x04000038; const UINT32 ADD_CERTHASH_ENTRY_RESPONSE = 0x04800038; const UINT32 DELETE_CERTHASH_ENTRY_REQUEST = 0x04000039; const UINT32 DELETE_CERTHASH_ENTRY_RESPONSE = 0x04800039; const PTHI_MESSAGE_HEADER DELETE_CERTHASH_ENTRY_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{DELETE_CERTHASH_ENTRY_REQUEST},sizeof(CFG_SET_CERTHASH_STATE_REQUEST) }; const UINT32 SET_ZTC_MODE_REQUEST = 0x0400003A; const UINT32 SET_ZTC_MODE_RESPONSE = 0x0480003A; const PTHI_MESSAGE_HEADER SET_ZTC_MODE_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{SET_ZTC_MODE_REQUEST},sizeof(CFG_SET_ZTC_MODE_REQUEST) }; #endif ztc-3.1.0.31/src/Utils.h0000644000175000017500000000514010662320062013264 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: Utils.h // //---------------------------------------------------------------------------- #ifndef _UTILS_H #define _UTILS_H #include #include "resource.h" #include "Types.h" /* * Constants */ #define MAX_LINE_LEN 300 #define UNIT8 unsigned char typedef struct _PARAMS_STRING { UINT16 Length; UINT8 String[MAX_LINE_LEN]; } PARAMS_STRING; typedef struct _LOCAL_AGENT_PARAMS { PARAMS_STRING OneTimePassword; PARAMS_STRING DnsSuffix; bool Verbose; bool Activate; }LOCAL_AGENT_PARAMS; /* * Function prototypes */ VOID DisplayErrorMessage(UINT32 errorCode); VOID DisplayMessage(UINT32 messageId); VOID DisplayString(UINT32 StringId); VOID DisplayStatusString(UINT32 statusStringID); UINT32 Parse(int argc, char* argv[],LOCAL_AGENT_PARAMS *Params); VOID PrintHelp(); #endif ztc-3.1.0.31/src/StringTableUtils.cpp0000644000175000017500000001352310662320062015762 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "Types.h" #include "StringTableUtils.h" #define MAX_STRING_TABLE_OFFSET 0x10000L map StringTableUtils::_stringTableMap; map StringTableUtils::_statusStringMap; DWORD StringTableUtils::GetLastError(void) { return(errno); } /* ------------------------------------------------------- * DisplayError * Show the last "errno" seen. * Note: even tests that PASS (they were supposed to cause * an error) may want to display the error number. * -------------------------------------------------------- */ void StringTableUtils::DisplayError(DWORD LastError) { printf(" *** Last error number: %d (0x%x)\n", (int)LastError, (unsigned int)LastError) ; } /* ----------------------------------------------------- * StringTableInit * Run this routine to read a resource file and * to create a table of strings in memory. * Returns: 0 - success, - fail * ----------------------------------------------------- */ BOOL StringTableUtils::StringTableInit(char *dat_filename,BOOL isStatus) { char buff[1024]; map smap; FILE *fptr; unsigned long d_indx; char *first_qptr, *last_qptr; /* * read the .dat file to get index and string pairs */ fptr = fopen(dat_filename, "r"); if (fptr == NULL) { printf("ERROR:StringTableInit unable to open for reading file: %s\n", dat_filename); return FALSE; } while (fgets(buff, 1023, fptr) != NULL) { // get string index if (sscanf(buff, "%lu ", &d_indx) != 1) { continue; } if (0 == d_indx) { sscanf(buff, "%lx ", &d_indx); } if (d_indx > MAX_STRING_TABLE_OFFSET) { printf("ERROR: StringTableInit found string index out of range in this line: %s\n", buff); continue; } // get actual string first_qptr = strchr(buff, '"'); if (first_qptr == NULL) { printf("ERROR: StringTableInit unable to find first quote in this line: %s\n", buff); continue; } last_qptr = strrchr(buff, '"'); if (last_qptr == NULL) { printf("ERROR: StringTableInit unable to find last quote in this line: %s\n", buff); continue; } if (last_qptr == first_qptr) { printf("ERROR: StringTableInit improper string format in this line: %s\n", buff); continue; } first_qptr++; std::string temp(first_qptr,(size_t)((last_qptr) - (first_qptr))); smap[d_indx] = temp; } if(isStatus) _statusStringMap = smap; else _stringTableMap = smap; return TRUE; } /* -------------------------------------------------------------- * LoadString * The Windows version of this function seems to get strings from * a resource file, given an reference number. This Linux version * depends on a StringMap being created from that resource file. * ------------------------------------------------------------------ */ int StringTableUtils::LoadString(LPVOID Instance, UINT Id, TCHAR *Buffer, UINT BufferMax) { /* For our small number of strings, the performance hit of looping * through the strings is negligible. Do it this way for simplicity. */ if (Buffer != NULL) { memset(Buffer, 0, BufferMax); strncpy((char *)Buffer, (char *)_stringTableMap[Id].c_str(), BufferMax - 1); return 0; } return 1; } /* -------------------------------------------------------------- * LoadString * The Windows version of this function seems to get strings from * a resource file, given an reference number. This Linux version * depends on a StringMap being created from that resource file. * ------------------------------------------------------------------ */ int StringTableUtils::LoadStatusString(LPVOID Instance, UINT Id, TCHAR *Buffer, UINT BufferMax) { /* For our small number of strings, the performance hit of looping * through the strings is negligible. Do it this way for simplicity. */ if (Buffer != NULL) { memset(Buffer, 0, BufferMax); strncpy((char *)Buffer, (char *)_statusStringMap[Id].c_str(), BufferMax - 1); return 0; } return 1; } /* ---------------------------------- * GetModuleHandle * ---------------------------------- */ LPVOID StringTableUtils::GetModuleHandle(LPSTR Dummy) { return NULL; } ztc-3.1.0.31/src/HECI_if.h0000644000175000017500000000763010662320061013357 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ // Define an Interface Guid for HECI device class. // This GUID is used to register (IoRegisterDeviceInterface) // an instance of an interface so that user application // can control the HECI device. // // GUID definition are required to be outside of header inclusion pragma to avoid // error during precompiled headers. // #ifndef __HECI_IF_H__ #define __HECI_IF_H__ typedef enum _HECI_STATUS{ HECI_STATUS_OK = 0x0, HECI_STATUS_GENERAL_ERROR = 0x2000, HECI_STATUS_LOCATE_DEVICE_ERROR, HECI_STATUS_MEMORY_ACCESS_ERROR, HECI_STATUS_WRITE_REGISTER_ERROR, HECI_STATUS_MEMORY_ALLOCATION_ERROR, HECI_STATUS_BUFFER_OVEREFLOW_ERROR, HECI_STATUS_NOT_ENOUGH_MEMORY, HECI_STATUS_MSG_TRANSMISSION_ERROR, HECI_STATUS_VERSION_MISMATCH, HECI_STATUS_UNEXPECTED_INTERRUPT_REASON, HECI_STATUS_TIMEOUT_ERROR, HECI_STATUS_UNEXPECTED_RESPONSE, HECI_STATUS_UNKNOWN_MESSAGE, HECI_STATUS_CANNOT_FOUND_HOST_CLIENT, HECI_STATUS_CANNOT_FOUND_ME_CLIENT, HECI_STATUS_CLIENT_ALREADY_CONNECTED, HECI_STATUS_NO_FREE_CONNECTION, HECI_STATUS_ILLEGAL_PARAMETER, HECI_STATUS_FLOW_CONTROL_ERROR, HECI_STATUS_NO_MESSAGE, HECI_STATUS_BUFFER_TOO_LARGE, HECI_STATUS_BUFFER_TOO_SMALL, HECI_STATUS_BUFFER_NOT_EMPTY, NUM_OF_HECI_STATUSES }HECI_STATUS; #define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) extern const GUID n = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} #define FILE_DEVICE_HECI 0x8000 // Define Interface reference/dereference routines for // Interfaces exported by IRP_MN_QUERY_INTERFACE #define HECI_IOCTL(index) \ CTL_CODE(FILE_DEVICE_HECI, index, METHOD_BUFFERED, FILE_READ_DATA) #define IOCTL_HECI_GET_VERSION \ CTL_CODE(FILE_DEVICE_HECI, 0x800, METHOD_BUFFERED, FILE_READ_ACCESS|FILE_WRITE_ACCESS) #define IOCTL_HECI_CONNECT_CLIENT \ CTL_CODE(FILE_DEVICE_HECI, 0x801, METHOD_BUFFERED, FILE_READ_ACCESS|FILE_WRITE_ACCESS) #define IOCTL_HECI_WD \ CTL_CODE(FILE_DEVICE_HECI, 0x802, METHOD_BUFFERED, FILE_READ_ACCESS|FILE_WRITE_ACCESS) #pragma pack(1) typedef struct _HECI_VERSION { UINT8 major; UINT8 minor; UINT8 hotfix; UINT16 build; } HECI_VERSION; typedef struct _HECI_CLIENT { UINT32 MaxMessageLength; UINT8 ProtocolVersion; } HECI_CLIENT; #pragma pack( ) #endif // __HECI_IF_H__ ztc-3.1.0.31/src/ZTCLocalAgent.h0000644000175000017500000000525410662320062014564 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: ZTCLocalAgent.h // //---------------------------------------------------------------------------- #ifndef _LOCAL_AGENT_H #define _LOCAL_AGENT_H #include "resource.h" #include "StatusCodeDefinitions.h" #include "WD_if.h" #include "Utils.h" #include "PTHICommand.h" #include "Types.h" /* * Type definitions */ /* * Constants */ #define AMT_TRUE 1 #define AMT_FALSE 0 #define STATE_INDEPNDENCE_CMD 0x5 #define STATE_INDEPNDENCE_BYTE_COUNT 0x2 #define STATE_INDEPNDENCE_ENABLED 0x51 #define STATE_INDEPNDENCE_VERSION 0x10 #define STATE_INDEPNDENCE_CHANGE_TO_AMT 0x52 /* * Function prototypes */ UINT32 DiscoveryTest(PTHICommand *command,bool isActivate); VOID DisplayLocalAgentVersion(); bool ChangeToAMT(); UINT32 Activate(PTHICommand *command,LOCAL_AGENT_PARAMS param); bool ReInitPTHI(PTHICommand *command); #endif ztc-3.1.0.31/src/StatusCodeDefinitions.h0000644000175000017500000003555610662320062016454 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: StatusCodeDefinitions.h // // Notes: This file contains the definitions of the status codes // as defined in the Intel® AMT Network Design Guide. // //---------------------------------------------------------------------------- #ifndef STATUS_CODE_DEFINITIONS_H #define STATUS_CODE_DEFINITIONS_H //Request succeeded #define PT_STATUS_SUCCESS 0x0 #define AMT_STATUS_SUCCESS 0x0 //An internal error in the Intel® AMT device has occurred #define PT_STATUS_INTERNAL_ERROR 0x1 #define AMT_STATUS_INTERNAL_ERROR 0x1 //Intel® AMT device has not progressed far enough in its //initialization to process the command. #define PT_STATUS_NOT_READY 0x2 #define AMT_STATUS_NOT_READY 0x2 //Command is not permitted in current operating mode. #define PT_STATUS_INVALID_PT_MODE 0x3 #define AMT_STATUS_INVALID_PT_MODE 0x3 //Length field of header is invalid. #define PT_STATUS_INVALID_MESSAGE_LENGTH 0x4 #define AMT_STATUS_INVALID_MESSAGE_LENGTH 0x4 //The requested hardware asset inventory table //checksum is not available. #define PT_STATUS_TABLE_FINGERPRINT_NOT_AVAILABLE 0x5 #define AMT_STATUS_TABLE_FINGERPRINT_NOT_AVAILABLE 0x5 //The Integrity Check Value field of the request //message sent by Intel® AMT enabled device is invalid. #define PT_STATUS_INTEGRITY_CHECK_FAILED 0x6 #define AMT_STATUS_INTEGRITY_CHECK_FAILED 0x6 //The specified ISV version is not supported #define PT_STATUS_UNSUPPORTED_ISVS_VERSION 0x7 #define AMT_STATUS_UNSUPPORTED_ISVS_VERSION 0x7 //The specified queried application is not registered. #define PT_STATUS_APPLICATION_NOT_REGISTERED 0x8 #define AMT_STATUS_APPLICATION_NOT_REGISTERED 0x8 //Either an invalid name or a not previously registered //“Enterprise” name was specified #define PT_STATUS_INVALID_REGISTRATION_DATA 0x9 #define AMT_STATUS_INVALID_REGISTRATION_DATA 0x9 //The application handle provided in the request //message has never been allocated. #define PT_STATUS_APPLICATION_DOES_NOT_EXIST 0xA #define AMT_STATUS_APPLICATION_DOES_NOT_EXIST 0xA //The requested number of bytes cannot be allocated in ISV storage. #define PT_STATUS_NOT_ENOUGH_STORAGE 0xB #define AMT_STATUS_NOT_ENOUGH_STORAGE 0xB //The specified name is invalid. #define PT_STATUS_INVALID_NAME 0xC #define AMT_STATUS_INVALID_NAME 0xC //The specified block does not exist. #define PT_STATUS_BLOCK_DOES_NOT_EXIST 0xD #define AMT_STATUS_BLOCK_DOES_NOT_EXIST 0xD //The specified byte offset is invalid. #define PT_STATUS_INVALID_BYTE_OFFSET 0xE #define AMT_STATUS_INVALID_BYTE_OFFSET 0xE //The specified byte count is invalid. #define PT_STATUS_INVALID_BYTE_COUNT 0xF #define AMT_STATUS_INVALID_BYTE_COUNT 0xF //The requesting application is not //permitted to request execution of the specified operation. #define PT_STATUS_NOT_PERMITTED 0x10 #define AMT_STATUS_NOT_PERMITTED 0x10 //The requesting application is not the owner of the block //as required for the requested operation. #define PT_STATUS_NOT_OWNER 0x11 #define AMT_STATUS_NOT_OWNER 0x11 //The specified block is locked by another application. #define PT_STATUS_BLOCK_LOCKED_BY_OTHER 0x12 #define AMT_STATUS_BLOCK_LOCKED_BY_OTHER 0x12 //The specified block is not locked. #define PT_STATUS_BLOCK_NOT_LOCKED 0x13 #define AMT_STATUS_BLOCK_NOT_LOCKED 0x13 //The specified group permission bits are invalid. #define PT_STATUS_INVALID_GROUP_PERMISSIONS 0x14 #define AMT_STATUS_INVALID_GROUP_PERMISSIONS 0x14 //The specified group does not exist. #define PT_STATUS_GROUP_DOES_NOT_EXIST 0x15 #define AMT_STATUS_GROUP_DOES_NOT_EXIST 0x15 //The specified member count is invalid. #define PT_STATUS_INVALID_MEMBER_COUNT 0x16 #define AMT_STATUS_INVALID_MEMBER_COUNT 0x16 //The request cannot be satisfied because a maximum //limit associated with the request has been reached. #define PT_STATUS_MAX_LIMIT_REACHED 0x17 #define AMT_STATUS_MAX_LIMIT_REACHED 0x17 //specified key algorithm is invalid. #define PT_STATUS_INVALID_AUTH_TYPE 0x18 #define AMT_STATUS_INVALID_AUTH_TYPE 0x18 //Not Used #define PT_STATUS_AUTHENTICATION_FAILED 0x19 #define AMT_STATUS_AUTHENTICATION_FAILED 0x19 //The specified DHCP mode is invalid. #define PT_STATUS_INVALID_DHCP_MODE 0x1A #define AMT_STATUS_INVALID_DHCP_MODE 0x1A //The specified IP address is not a valid IP unicast address. #define PT_STATUS_INVALID_IP_ADDRESS 0x1B #define AMT_STATUS_INVALID_IP_ADDRESS 0x1B //The specified domain name is not a valid domain name. #define PT_STATUS_INVALID_DOMAIN_NAME 0x1C #define AMT_STATUS_INVALID_DOMAIN_NAME 0x1C //Not Used #define PT_STATUS_UNSUPPORTED_VERSION 0x1D #define AMT_STATUS_UNSUPPORTED_VERSION 0x1D //The requested operation cannot be performed because a //prerequisite request message has not been received. #define PT_STATUS_REQUEST_UNEXPECTED 0x1E #define AMT_STATUS_REQUEST_UNEXPECTED 0x1E //Not Used #define PT_STATUS_INVALID_TABLE_TYPE 0x1F #define AMT_STATUS_INVALID_TABLE_TYPE 0x1F //The specified provisioning mode code is undefined. #define PT_STATUS_INVALID_PROVISIONING_STATE 0x20 #define AMT_STATUS_INVALID_PROVISIONING_STATE 0x20 //Not Used #define PT_STATUS_UNSUPPORTED_OBJECT 0x21 #define AMT_STATUS_UNSUPPORTED_OBJECT 0x21 //The specified time was not accepted by the Intel® AMT device //since it is earlier than the baseline time set for the device. #define PT_STATUS_INVALID_TIME 0x22 #define AMT_STATUS_INVALID_TIME 0x22 //StartingIndex is invalid. #define PT_STATUS_INVALID_INDEX 0x23 #define AMT_STATUS_INVALID_INDEX 0x23 //A parameter is invalid. #define PT_STATUS_INVALID_PARAMETER 0x24 #define AMT_STATUS_INVALID_PARAMETER 0x24 //An invalid netmask was supplied //(a valid netmask is an IP address in which all ‘1’s are before //the ‘0’ – e.g. FFFC0000h is valid, FF0C0000h is invalid). #define PT_STATUS_INVALID_NETMASK 0x25 #define AMT_STATUS_INVALID_NETMASK 0x25 //The operation failed because the Flash wear-out //protection mechanism prevented a write to an NVRAM sector. #define PT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED 0x26 #define AMT_STATUS_FLASH_WRITE_LIMIT_EXCEEDED 0x26 //ME FW did not receive the entire image file. #define PT_STATUS_INVALID_IMAGE_LENGTH 0x27 #define AMT_STATUS_INVALID_IMAGE_LENGTH 0x27 //ME FW received an image file with an invalid signature. #define PT_STATUS_INVALID_IMAGE_SIGNATURE 0x28 #define AMT_STATUS_INVALID_IMAGE_SIGNATURE 0x28 //LME can not support the requested version. #define PT_STATUS_PROPOSE_ANOTHER_VERSION 0x29 #define AMT_STATUS_PROPOSE_ANOTHER_VERSION 0x29 //The PID must be a 64 bit quantity made up of ASCII codes //of some combination of 8 characters – //capital alphabets (A–Z), and numbers (0–9). #define PT_STATUS_INVALID_PID_FORMAT 0x2A #define AMT_STATUS_INVALID_PID_FORMAT 0x2A //The PPS must be a 256 bit quantity made up of ASCII codes //of some combination of 32 characters – //capital alphabets (A–Z), and numbers (0–9). #define PT_STATUS_INVALID_PPS_FORMAT 0x2B #define AMT_STATUS_INVALID_PPS_FORMAT 0x2B //Full BIST test has been blocked #define PT_STATUS_BIST_COMMAND_BLOCKED 0x2C #define AMT_STATUS_BIST_COMMAND_BLOCKED 0x2C //A TCP/IP connection could not be opened on with the selected port. #define PT_STATUS_CONNECTION_FAILED 0x2D #define AMT_STATUS_CONNECTION_FAILED 0x2D //Max number of connection reached. //LME can not open the requested connection. #define PT_STATUS_CONNECTION_TOO_MANY 0x2E #define AMT_STATUS_CONNECTION_TOO_MANY 0x2E //Random key generation is in progress. #define PT_STATUS_RNG_GENERATION_IN_PROGRESS 0x2F #define AMT_STATUS_RNG_GENERATION_IN_PROGRESS 0x2F //A randomly generated key does not exist. #define PT_STATUS_RNG_NOT_READY 0x30 #define AMT_STATUS_RNG_NOT_READY 0x30 //Self-generated AMT certificate does not exist. #define PT_STATUS_CERTIFICATE_NOT_READY 0x31 #define AMT_STATUS_CERTIFICATE_NOT_READY 0x31 //This code establishes a dividing line between //status codes which are common to host interface and //network interface and status codes which are used by //network interface only. #define PT_STATUS_NETWORK_IF_ERROR_BASE 0x800 #define AMT_STATUS_NETWORK_IF_ERROR_BASE 0x800 //The OEM number specified in the remote control //command is not supported by the Intel® AMT device #define PT_STATUS_UNSUPPORTED_OEM_NUMBER 0x801 #define AMT_STATUS_UNSUPPORTED_OEM_NUMBER 0x801 //The boot option specified in the remote control command //is not supported by the Intel® AMT device #define PT_STATUS_UNSUPPORTED_BOOT_OPTION 0x802 #define AMT_STATUS_UNSUPPORTED_BOOT_OPTION 0x802 //The command specified in the remote control command //is not supported by the Intel® AMT device #define PT_STATUS_INVALID_COMMAND 0x803 #define AMT_STATUS_INVALID_COMMAND 0x803 //The special command specified in the remote control command //is not supported by the Intel® AMT device #define PT_STATUS_INVALID_SPECIAL_COMMAND 0x804 #define AMT_STATUS_INVALID_SPECIAL_COMMAND 0x804 //The handle specified in the command is invalid #define PT_STATUS_INVALID_HANDLE 0x805 #define AMT_STATUS_INVALID_HANDLE 0x805 //The password specified in the User ACL is invalid #define PT_STATUS_INVALID_PASSWORD 0x806 #define AMT_STATUS_INVALID_PASSWORD 0x806 //The realm specified in the User ACL is invalid #define PT_STATUS_INVALID_REALM 0x807 #define AMT_STATUS_INVALID_REALM 0x807 //The FPACL or EACL entry is used by an active //registration and cannot be removed or modified. #define PT_STATUS_STORAGE_ACL_ENTRY_IN_USE 0x808 #define AMT_STATUS_STORAGE_ACL_ENTRY_IN_USE 0x808 //Essential data is missing on CommitChanges command. #define PT_STATUS_DATA_MISSING 0x809 #define AMT_STATUS_DATA_MISSING 0x809 //The parameter specified is a duplicate of an existing value. //Returned for a case where duplicate entries are added to FPACL //(Factory Partner Allocation Control List) or EACL //(Enterprise Access Control List) lists. #define PT_STATUS_DUPLICATE 0x80A #define AMT_STATUS_DUPLICATE 0x80A //Event Log operation failed due to the current freeze status of the log. #define PT_STATUS_EVENTLOG_FROZEN 0x80B #define AMT_STATUS_EVENTLOG_FROZEN 0x80B //The device is missing private key material. #define PT_STATUS_PKI_MISSING_KEYS 0x80C #define AMT_STATUS_PKI_MISSING_KEYS 0x80C //The device is currently generating a keypair. //Caller may try repeating this operation at a later time. #define PT_STATUS_PKI_GENERATING_KEYS 0x80D #define AMT_STATUS_PKI_GENERATING_KEYS 0x80D //An invalid Key was entered. #define PT_STATUS_INVALID_KEY 0x80E #define AMT_STATUS_INVALID_KEY 0x80E //An invalid X.509 certificate was entered. #define PT_STATUS_INVALID_CERT 0x80F #define AMT_STATUS_INVALID_CERT 0x80F //Certificate Chain and Private Key do not match. #define PT_STATUS_CERT_KEY_NOT_MATCH 0x810 #define AMT_STATUS_CERT_KEY_NOT_MATCH 0x810 //The request cannot be satisfied because the maximum //number of allowed Kerberos domains has been reached. //(The domain is determined by the first 24 Bytes of the SID.) #define PT_STATUS_MAX_KERB_DOMAIN_REACHED 0x811 #define AMT_STATUS_MAX_KERB_DOMAIN_REACHED 0x811 // The requested configuration is unsupported #define PT_STATUS_UNSUPPORTED 0x812 #define AMT_STATUS_UNSUPPORTED 0x812 // A profile with the requested priority already exists #define PT_STATUS_INVALID_PRIORITY 0x813 #define AMT_STATUS_INVALID_PRIORITY 0x813 // Unable to find specified element #define PT_STATUS_NOT_FOUND 0x814 #define AMT_STATUS_NOT_FOUND 0x814 // Invalid User credentials #define PT_STATUS_INVALID_CREDENTIALS 0x815 #define AMT_STATUS_INVALID_CREDENTIALS 0x815 // Passphrase is invalid #define PT_STATUS_INVALID_PASSPHRASE 0x816 #define AMT_STATUS_INVALID_PASSPHRASE 0x816 // A certificate handle must be chosen before the // operation can be completed. #define PT_STATUS_NO_ASSOCIATION 0x818 #define AMT_STATUS_NO_ASSOCIATION 0x818 //The application has identified an internal error #define PTSDK_STATUS_INTERNAL_ERROR 0x1000 //An ISV operation was called while the library is not //initialized #define PTSDK_STATUS_NOT_INITIALIZED 0x1001 //The requested library I/F is not supported by the current library //implementation. #define PTSDK_STATUS_LIB_VERSION_UNSUPPORTED 0x1002 //One of the parameters is invalid (usually indicates a //NULL pointer or an invalid session handle is specified) #define PTSDK_STATUS_INVALID_PARAM 0x1003 //The SDK could not allocate sufficient resources to complete the operation. #define PTSDK_STATUS_RESOURCES 0x1004 //The Library has identified a HW Internal error. #define PTSDK_STATUS_HARDWARE_ACCESS_ERROR 0x1005 //The application that sent the request message is not registered. //Usually indicates the registration timeout has elapsed. //The caller should reregister with the Intel AMT enabled device. #define PTSDK_STATUS_REQUESTOR_NOT_REGISTERED 0x1006 //A network error has occurred while processing the call. #define PTSDK_STATUS_NETWORK_ERROR 0x1007 //Specified container can not hold the requested string #define PTSDK_STATUS_PARAM_BUFFER_TOO_SHORT 0x1008 //For Windows only. //ISVS_InitializeCOMinThread was not called by the current thread. #define PTSDK_STATUS_COM_NOT_INITIALIZED_IN_THREAD 0x1009 //The URL parameter was not optional in current configuration. #define PTSDK_STATUS_URL_REQUIRED 0x100A #endif ztc-3.1.0.31/src/version.h0000644000175000017500000000442410662320577013670 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifndef __VERSION_H__ #define __VERSION_H__ #define MAJOR_VERSION 3 #define MINOR_VERSION 1 #define QUICK_FIX_NUMBER 0 #define VER_BUILD 31 #define _MAKE_VER_STRING(maj, min, submin, bld) #maj "." #min "." #submin "." #bld #define MAKE_VER_STRING(maj, min, submin, bld) _MAKE_VER_STRING(maj, min, submin, bld) #define VER_PRODUCTVERSION MAJOR_VERSION,MINOR_VERSION,QUICK_FIX_NUMBER,VER_BUILD #define VER_PRODUCTVERSION_STR MAKE_VER_STRING(MAJOR_VERSION, MINOR_VERSION, QUICK_FIX_NUMBER, VER_BUILD) #endif ztc-3.1.0.31/src/ZTCLocalAgent.cpp0000644000175000017500000003563010662320062015120 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: LocalAgent.cpp // //---------------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "ZTCLocalAgent.h" #include "HECILinux.h" #include "resource.h" #include "version.h" #include "Utils.h" #include "Types.h" #include "HECI_if.h" #include "StringTableUtils.h" static bool _verbose = false; /* * This is a main entry point */ int main(UINT32 argc, CHAR *argv[]) { AMT_STATUS status; LOCAL_AGENT_PARAMS param; StringTableUtils::StringTableInit("StatusStrings.dat",TRUE); StringTableUtils::StringTableInit("ZTCLocalAgent.dat",FALSE); status = Parse(argc, argv, ¶m); if (AMT_STATUS_SUCCESS != status ) { PrintHelp(); return status; } _verbose = param.Verbose; // Print Local Agent version DisplayLocalAgentVersion(); PTHICommand command(_verbose); status = DiscoveryTest(&command,param.Activate); if(AMT_STATUS_SUCCESS == status && param.Activate) { status = Activate(&command, param); } if (AMT_STATUS_SUCCESS != status ) { DisplayStatusString(status); return status; } return status; } /* * Calls to DiscoveryTest for check AMT configuration. * Arguments: * isActivate - if this test running for start amt configuration * Return values: * AMT_STATUS_SUCCESS - on success for get amt configuration data * appropriate error value defined in StatusCodeDefinitions.h - on failure */ UINT32 DiscoveryTest(PTHICommand *command,bool isActivate) { AMT_STATUS status =AMT_STATUS_SUCCESS ; CODE_VERSIONS CodeVersions; AMT_HASH_HANDLES HashHandles; AMT_PROVISIONING_STATE provstate; AMT_BOOLEAN legacy; CFG_PROVISIONING_MODE mode; bool isReinit = false; if(true != command->PTHIClient.Init()) { if(INVALID_HANDLE_VALUE == command->PTHIClient.GetHandle()) { DisplayErrorMessage(LA_HECI_NOT_INSTALLED_ERROR); status = AMT_STATUS_INTERNAL_ERROR; } else { command->PTHIClient.Deinit(); DisplayErrorMessage( HECI_CONNECT_TO_PTHI_CLIENT_FAILURE ); if(!isActivate) { return status; } if(true == ChangeToAMT()) { DisplayMessage(WORD_CHANGE_TO_AMT); DisplayMessage(WORD_SUCCESS); isReinit = ReInitPTHI(command); } else { DisplayErrorMessage( CHANGE_TO_AMT_FAILURE ); status = AMT_STATUS_INTERNAL_ERROR; } } if(!isReinit) return status; } status = command->GetCodeVersions(&CodeVersions); if (AMT_STATUS_SUCCESS == status ) { command->DisplayCodeVersions(&CodeVersions); } else { DisplayStatusString(status); } // provisioning state status = command->GetProvisioningState(&provstate); if (AMT_STATUS_SUCCESS == status ) { command->DisplayProvisioningState(&provstate); } else { DisplayStatusString(status); } // provisioning mode status = command->GetProvisioningMode(&legacy,&mode); if (AMT_STATUS_SUCCESS == status ) { if(PROVISIONING_STATE_PRE == provstate && PROVISIONING_MODE_SMB == mode) { command->PTHIClient.Deinit(); if(!isActivate) { return status; } if(true == ChangeToAMT()) { DisplayMessage(WORD_CHANGE_TO_AMT); DisplayMessage(WORD_SUCCESS); isReinit = ReInitPTHI(command); } else { DisplayErrorMessage( CHANGE_TO_AMT_FAILURE ); status = AMT_STATUS_INTERNAL_ERROR; } } if(!isReinit) return status; } else { DisplayStatusString(status); return status; } if(true==isActivate && PROVISIONING_STATE_PRE != provstate) { status = AMT_STATUS_INVALID_PROVISIONING_STATE; } //enumerate hash handles status = command->EnumerateHashHandles(&HashHandles); if (AMT_STATUS_SUCCESS == status ) { // print all handles in here if any if(HashHandles.Length > 0) { DisplayMessage(FOUND); fprintf(stdout," %d ",HashHandles.Length); DisplayString(CERT_HASHES_IN_FW); fprintf(stdout,"\n"); for(UINT32 i = 0;iGetCertificateHashEntry(HashHandles.Handles[i],&HashEntry); if (AMT_STATUS_SUCCESS != status ) { DisplayStatusString(status); } else { command->DisplayHashEntry(HashEntry); if(NULL != HashEntry.Name.Buffer) free(HashEntry.Name.Buffer); } } } else { DisplayMessage(NO_HANDLES_FOUND); fprintf(stdout,"\n"); } } else { DisplayStatusString(status); } return status; } /* * Calls to Activate AMT configuration. * Arguments: * param - Local agent parameters structure * Return values: * PT_STATUS_SUCCESS - on success for get amt configuration data * appropriate error value defined in StatusCodeDefinitions.h - on failure */ UINT32 Activate(PTHICommand *command,LOCAL_AGENT_PARAMS param) { AMT_STATUS status; AMT_BOOLEAN legacy; AMT_BOOLEAN ztcEnabled; AMT_PROVISIONING_TLS_MODE provisioningTlsMode; AMT_RNG_STATUS rngStatus; AMT_ANSI_STRING dnsSuffix; AMT_ANSI_STRING tempDnsSuffix; AMT_ANSI_STRING otp; AMT_PROVISIONING_STATE provstate; CFG_PROVISIONING_MODE mode; do { // legacy mode provisioning status = command->GetProvisioningMode(&legacy,&mode); if (AMT_STATUS_SUCCESS == status ) { command->DisplayAMTMode(&legacy); } else { DisplayStatusString(status); break; } if(legacy && 0!= param.OneTimePassword.Length) { status = AMT_STATUS_INVALID_PT_MODE; DisplayStatusString(status); break; } // ZTC enabled status = command->GetZeroTouchEnabled(&ztcEnabled); if (AMT_STATUS_SUCCESS == status ) { command->DisplayZTCEnabled(&ztcEnabled); } else { DisplayStatusString(status); break; } if(!ztcEnabled && 0!= param.OneTimePassword.Length) { status = AMT_STATUS_INVALID_PT_MODE; DisplayStatusString(status); break; } // Get provisioning TLS mode status = command->GetProvisioningTlsMode(&provisioningTlsMode); if (AMT_STATUS_SUCCESS == status ) { command->DisplayProvisioningTlsMode(&provisioningTlsMode); } else { DisplayStatusString(status); break; } if(PSK == provisioningTlsMode && 0!= param.OneTimePassword.Length) { status = PTSDK_STATUS_INVALID_PARAM; DisplayStatusString(status); break; } if(PSK != provisioningTlsMode && ztcEnabled ) { //Generate Rng Key status = command->GenerateRngKey(); if(AMT_STATUS_SUCCESS != status && AMT_STATUS_RNG_GENERATION_IN_PROGRESS != status) { DisplayStatusString(status); break; } else if(AMT_STATUS_RNG_GENERATION_IN_PROGRESS == status) { for(int i = 0; i < 12; i++) { sleep(5);//5 seconds if(true != command->PTHIClient.Init()) continue; // Calling GetRngSeedStatus() too soon might fail. // We need to give the firmware time to finish its reset // and to generate the RNG seed. sleep(5);//seconds status = command->GetRngSeedStatus(&rngStatus); if(status == AMT_STATUS_SUCCESS) { break; } } } else { status = command->GetRngSeedStatus(&rngStatus); } if (AMT_STATUS_SUCCESS == status ) { command->DisplayRngSeedStatus(&rngStatus); } else { DisplayStatusString(status); break; } if( RNG_STATUS_EXIST != rngStatus) { status = AMT_STATUS_PKI_MISSING_KEYS; DisplayStatusString(status); break; } if(0 != param.DnsSuffix.Length) { dnsSuffix.Length = param.DnsSuffix.Length; dnsSuffix.Buffer = (CHAR*)malloc(dnsSuffix.Length); if (NULL == dnsSuffix.Buffer) { status = AMT_STATUS_INTERNAL_ERROR; DisplayErrorMessage(ALLOCATE_MEMORY_ERROR); break; } memcpy(dnsSuffix.Buffer,param.DnsSuffix.String,dnsSuffix.Length); status = command->SetDnsSuffix(dnsSuffix); if (AMT_STATUS_SUCCESS != status ) { DisplayStatusString(status); if(NULL != dnsSuffix.Buffer) free(dnsSuffix.Buffer); break; } status = command->GetDnsSuffix(&tempDnsSuffix); if (AMT_STATUS_SUCCESS != status ) { DisplayStatusString(status); if(NULL != dnsSuffix.Buffer) free(dnsSuffix.Buffer); break; } if(tempDnsSuffix.Length!=dnsSuffix.Length ||0!=memcmp(dnsSuffix.Buffer,tempDnsSuffix.Buffer,tempDnsSuffix.Length)) { status=AMT_STATUS_INTERNAL_ERROR; DisplayStatusString(status); if(NULL != dnsSuffix.Buffer) free(dnsSuffix.Buffer); if(NULL != tempDnsSuffix.Buffer) free(tempDnsSuffix.Buffer); break; } if(NULL != dnsSuffix.Buffer) free(dnsSuffix.Buffer); if(NULL != tempDnsSuffix.Buffer) free(tempDnsSuffix.Buffer); } if(0 != param.OneTimePassword.Length) { otp.Length = param.OneTimePassword.Length; otp.Buffer = (CHAR*)malloc(otp.Length); if (NULL == otp.Buffer) { status = AMT_STATUS_INTERNAL_ERROR; DisplayErrorMessage(ALLOCATE_MEMORY_ERROR); break; } memcpy(otp.Buffer,param.OneTimePassword.String,otp.Length); status = command->SetProvisioningServerOTP(otp); if(NULL != otp.Buffer) free(otp.Buffer); if (AMT_STATUS_SUCCESS != status ) { DisplayStatusString(status); break; } } } //Start configuration status = command->StartConfiguration(); if(AMT_STATUS_SUCCESS != status && AMT_STATUS_CERTIFICATE_NOT_READY != status ) { DisplayStatusString(status); break; } else if(AMT_STATUS_CERTIFICATE_NOT_READY == status) { if(PSK == provisioningTlsMode) { DisplayStatusString(status); break; } else { for(int i = 0; i < 20; i++) { sleep(30);//30 seconds // provisioning state status = command->GetProvisioningState(&provstate); if (AMT_STATUS_SUCCESS == status ) { if( PROVISIONING_STATE_IN == provstate) { command->DisplayProvisioningState(&provstate); break; } } else { DisplayStatusString(status); break; } } if(AMT_STATUS_SUCCESS == status && PROVISIONING_STATE_IN != provstate) { command->DisplayProvisioningState(&provstate); status = AMT_STATUS_INVALID_PROVISIONING_STATE; DisplayStatusString(status); break; } } } }while(0); DisplayMessage(WORD_AMT_CONFIG_ACTIVATE); if(AMT_STATUS_SUCCESS == status) { DisplayMessage(WORD_SUCCESS); fprintf(stdout,"\n"); } else { DisplayMessage(WORD_FAILURE); fprintf(stdout,"\n"); } return status; } // Define GUID used to connect to the Watchdog client (via the HECI device) // {05B79A6F-4628-4D7F-899D-A91514CB32AB} DEFINE_GUID(HECI_WATCHDOG_GUID,0x05B79A6F, 0x4628, 0x4D7F, 0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB); /* * Change SCU to AMT */ bool ChangeToAMT() { UCHAR *rxBuff = (UCHAR *)NULL; DWORD bytesRead, bytesWritten; unsigned long bufSize; HECILinux WDClient(HECI_WATCHDOG_GUID,_verbose); if(true != WDClient.Init()) { if (_verbose) { DisplayErrorMessage(HECI_CONNECT_TO_WD_CLIENT_FAILURE); fprintf(stdout,"\n"); } return false; } bufSize = WDClient.GetBufferSize(); if (bufSize < sizeof(STATE_INDEPNDENCE_COMMAND)) { if (_verbose) { DisplayErrorMessage(FW_BUFFER_IS_TO_SMALL); } goto err; } rxBuff = (UCHAR *)malloc(bufSize); if (NULL == rxBuff) { if (_verbose) { DisplayErrorMessage(ALLOCATE_MEMORY_ERROR); } goto err; } STATE_INDEPNDENCE_COMMAND msg; msg.Cmd = STATE_INDEPNDENCE_CMD; msg.ByteCount = STATE_INDEPNDENCE_BYTE_COUNT; msg.SubCmd = STATE_INDEPNDENCE_ENABLED; msg.Version = STATE_INDEPNDENCE_VERSION; bytesWritten = WDClient.SendMessage((UCHAR *)&msg, sizeof(msg)); if (bytesWritten != sizeof(msg)) { if (_verbose) { DisplayErrorMessage(SEND_DATA_TO_FW_FAILURE); } goto err; } STATE_INDEPENDECE_IS_CHANGE_ENABLED_REPLY repEnabledMsg; bytesRead = WDClient.ReceiveMessage(rxBuff, bufSize); if (bytesRead != sizeof(STATE_INDEPENDECE_IS_CHANGE_ENABLED_REPLY)) { if (_verbose) { DisplayErrorMessage(RECEIVE_DATA_FROM_FW_FAILURE); } goto err; } memcpy(&repEnabledMsg,rxBuff,sizeof(STATE_INDEPENDECE_IS_CHANGE_ENABLED_REPLY)); if (!repEnabledMsg.Enabled) { goto err; } //Send change to AMT msg.SubCmd = STATE_INDEPNDENCE_CHANGE_TO_AMT; bytesWritten = WDClient.SendMessage((UCHAR *)&msg, sizeof(msg)); if (bytesWritten != sizeof(msg)) { if (_verbose) { DisplayErrorMessage(SEND_DATA_TO_FW_FAILURE); } goto err; } STATE_INDEPENDECE_CHANGE_TO_AMT_REPLY repChangeToAMTMsg; bytesRead = WDClient.ReceiveMessage(rxBuff, bufSize); if (bytesRead != sizeof(STATE_INDEPENDECE_CHANGE_TO_AMT_REPLY)) { if (_verbose) { DisplayErrorMessage(RECEIVE_DATA_FROM_FW_FAILURE); } goto err; } memcpy(&repChangeToAMTMsg,rxBuff,sizeof(STATE_INDEPENDECE_CHANGE_TO_AMT_REPLY)); if (HECI_STATUS_OK != repChangeToAMTMsg.Status) { goto err; } free(rxBuff); WDClient.Deinit(); return true; err: if (rxBuff) free(rxBuff); WDClient.Deinit(); return false; } void DisplayLocalAgentVersion() { fprintf(stdout,"\n"); DisplayMessage(VERSION_MESSAGE); fprintf(stdout,"%d.%d.%d.%d\n\n", MAJOR_VERSION, MINOR_VERSION, QUICK_FIX_NUMBER, VER_BUILD); } bool ReInitPTHI(PTHICommand *command) { for(int i = 0; i < 12; i++) { sleep(5); if(true != command->PTHIClient.Init()) continue; else { return true; } } return false; } ztc-3.1.0.31/src/HECILinux.h0000644000175000017500000000441310662320061013715 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifndef __HECI_LINUX_H__ #define __HECI_LINUX_H__ #include "heci.h" #define INVALID_HANDLE_VALUE -1 class HECILinux : public HECI { public: HECILinux(const GUID guid, bool verbose = true); virtual ~HECILinux(); virtual bool Init(); virtual void Deinit(); virtual int ReceiveMessage(unsigned char *buffer, int len, unsigned long timeout = 2000); virtual int SendMessage(unsigned char *buffer, int len, unsigned long timeout = 2000); virtual unsigned long GetBufferSize() { return _bufSize; } int GetHandle(); private: int _fd; }; #endif // __HECI_LINUX_H__ ztc-3.1.0.31/src/Options.cpp0000644000175000017500000001171010662320061014151 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: Options.cpp // // contents: This file contains the implementation of a generic class for command line options // parsing. // //---------------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "Options.h" #include #include using namespace std; #ifndef WIN32 #include #define stricmp strcasecmp #endif bool Options::StrLess::operator()(const char* left, const char* right) const { return (stricmp(left, right) < 0); } Options::Format::Format(const Options::FormatNode rawFormat[], int rawFormatSize) { for (int i=0; isecond; } bool Options::optionExists(const char* option) const { return m_optionsMap.find(option) != m_optionsMap.end(); } /* This parsing function goes over the command line, looking for words that begin with '-'. When '-' is found, we check if this is a valid option. If it is, and it has a parameter, the next word in the command line is assumed to be its value. */ bool Options::parse(int argc, const char* argv[], const Format &format) { const char* optionName = NULL; const char* optionVal = NULL; if ((argv == NULL) || (argc < 0)) return false; //We start from the second parameter, since the first is the program name. for (int i=1; i= argc) return false; //error - this option should have a parameter. optionVal = argv[i]; } else { optionVal = ""; } m_optionsMap[optionName] = optionVal; } } m_parsed = true; return true; } bool Options::parse(int argc, const char* argv[], const FormatNode rawFormat[], int rawFormatSize) { return parse(argc, argv, Format(rawFormat, rawFormatSize)); } Options::Options(int argc, const char* argv[], const Format &format) { parse(argc, argv, format); } Options::Options(int argc, const char* argv[], const FormatNode rawFormat[], int rawFormatSize) { parse(argc, argv, rawFormat, rawFormatSize); } Options::Options() { m_parsed = false; } const char* Options::getOption(const char* option) const { OptionsMap::const_iterator it = m_optionsMap.find(option); return (it == m_optionsMap.end()) ? NULL : it->second; } ztc-3.1.0.31/src/Types.h0000644000175000017500000001315310662320062013273 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifndef _TYPES_H_ #define _TYPES_H_ typedef unsigned int PT_STATUS; typedef unsigned int AMT_STATUS; typedef char CHAR; typedef signed char INT8, *PINT8; typedef signed short INT16, *PINT16; typedef signed int INT32, *PINT32; //typedef signed __int64 INT64, *PINT64; typedef unsigned char UINT8, *PUINT8, UCHAR; typedef unsigned short UINT16, *PUINT16; typedef unsigned int UINT32, *PUINT32; //typedef unsigned __int64 UINT64, *PUINT64; #ifndef CONST #define CONST const #endif #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif typedef unsigned long DWORD; typedef int BOOL; typedef unsigned char BYTE; typedef unsigned short WORD; typedef float FLOAT; typedef FLOAT *PFLOAT; typedef BOOL *PBOOL; typedef BOOL *LPBOOL; typedef BYTE *PBYTE; typedef BYTE *LPBYTE; typedef int *PINT; typedef int *LPINT; typedef WORD *PWORD; typedef WORD *LPWORD; typedef long *LPLONG; typedef DWORD *PDWORD; typedef DWORD *LPDWORD; typedef void *LPVOID; typedef CONST void *LPCVOID; typedef int INT; typedef unsigned int UINT; typedef unsigned int *PUINT; // // UNICODE (Wide Character) types // typedef unsigned short WCHAR; typedef WCHAR *PWCHAR, *LPWCH, *PWCH; typedef CONST WCHAR *LPCWCH, *PCWCH; typedef WCHAR *NWPSTR, *LPWSTR, *PWSTR; typedef PWSTR *PZPWSTR; typedef CONST PWSTR *PCZPWSTR; typedef WCHAR *LPUWSTR, *PUWSTR; typedef CONST WCHAR *LPCWSTR, *PCWSTR; typedef PCWSTR *PZPCWSTR; typedef CONST WCHAR *LPCUWSTR, *PCUWSTR; // // ANSI (Multi-byte Character) types // typedef CHAR *PCHAR, *LPCH, *PCH; typedef CONST CHAR *LPCCH, *PCCH; typedef CHAR *NPSTR, *LPSTR, *PSTR; typedef PSTR *PZPSTR; typedef CONST PSTR *PCZPSTR; typedef CONST CHAR *LPCSTR, *PCSTR; typedef PCSTR *PZPCSTR; // // Neutral ANSI/UNICODE types and macros // #ifdef UNICODE #ifndef _TCHAR_DEFINED typedef WCHAR TCHAR, *PTCHAR; typedef WCHAR TBYTE , *PTBYTE ; #define _TCHAR_DEFINED #endif /* !_TCHAR_DEFINED */ typedef LPWSTR LPTCH, PTCH; typedef LPWSTR PTSTR, LPTSTR; typedef LPCWSTR PCTSTR, LPCTSTR; typedef LPUWSTR PUTSTR, LPUTSTR; typedef LPCUWSTR PCUTSTR, LPCUTSTR; typedef LPWSTR LP; #define __TEXT(quote) L##quote #else /* UNICODE */ #ifndef _TCHAR_DEFINED typedef char TCHAR, *PTCHAR; typedef unsigned char TBYTE , *PTBYTE ; #define _TCHAR_DEFINED #endif /* !_TCHAR_DEFINED */ typedef LPSTR LPTCH, PTCH; typedef LPSTR PTSTR, LPTSTR, PUTSTR, LPUTSTR; typedef LPCSTR PCTSTR, LPCTSTR, PCUTSTR, LPCUTSTR; typedef unsigned long DWORD; typedef unsigned char BYTE; typedef BOOL *PBOOL,*LPBOOL; typedef unsigned short WORD; typedef float FLOAT; typedef FLOAT *PFLOAT; typedef BYTE *PBYTE,*LPBYTE; typedef int *PINT,*LPINT; typedef WORD *PWORD,*LPWORD; typedef long *LPLONG; typedef DWORD *PDWORD,*LPDWORD; typedef CONST void *PCVOID,*LPCVOID; typedef int INT; typedef unsigned int UINT,*PUINT,*LPUINT; // (from winnt.h) #define VOID void typedef char CHAR; typedef short SHORT; typedef char CCHAR, *PCCHAR; typedef unsigned char UCHAR,*PUCHAR; typedef unsigned short USHORT,*PUSHORT; typedef unsigned long ULONG,*PULONG; typedef char *PSZ; typedef unsigned long DWORD_PTR, *PDWORD_PTR; typedef char TCHAR; typedef void *PVOID,*LPVOID; typedef CONST WCHAR *LPCWCH,*PCWCH,*LPCWSTR,*PCWSTR; typedef CHAR *PCHAR,*LPCH,*PCH,*NPSTR,*LPSTR,*PSTR; typedef CONST CHAR *LPCCH,*PCSTR,*LPCSTR; #define __TEXT(quote) quote #endif /* UNICODE */ #define TEXT(quote) __TEXT(quote) #ifndef WIN32 #define EVENTLOG_ERROR_TYPE LOG_ERR #define EVENTLOG_WARNING_TYPE LOG_WARNING #define EVENTLOG_INFORMATION_TYPE LOG_INFO #ifndef VOID #define VOID void #endif #endif /* _LINUX */ #endif /* _TYPES_H_ */ ztc-3.1.0.31/src/resource.h0000644000175000017500000001274010662320062014017 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ // Used by ZTCLocalAgent.str // #define AMT_LOCAL_AGENT_STATUS_SUCCESS 0 #define USAGE 1 #define ERROR_MESSAGE 2 #define VERSION_MESSAGE 3 #define HECI_ERROR_MESSAGE 4 #define UNKNOWN 5 #define HECI_CONNECT_TO_FWU_CLIENT_FAILURE 6 #define WRITE_FILE_TIME_OUT 7 #define ME_FW_INFO 8 #define ME_MODE 9 #define IOCTL_COMMAND 10 #define WRITE_FILE 11 #define READ_FILE 12 #define GET_CLASS_DEVS 13 #define GET_INTERFACE_DETAIL 14 #define ICH_VERSION 15 #define FIND_HECI_FAILURE 16 #define CREATE_HECI_FILE 17 #define CREATE_HECI_FILE_FAILURE 17 #define GET_HECI_DRIVER_VERSION_FAILURE 18 #define LA_STATUS_INTERNAL_ERROR 19 #define HECI_CONNECT_TO_PTHI_CLIENT_FAILURE 20 #define LA_HECI_ERROR 21 #define ALLOCATE_MEMORY_ERROR 22 #define LA_HECI_NOT_INSTALLED_ERROR 23 #define FW_BUFFER_IS_TO_SMALL 24 #define SEND_DATA_TO_FW_FAILURE 25 #define RECEIVE_DATA_FROM_FW_FAILURE 26 #define GET_INFO_FROM_HECI_FAILURE 27 #define MCH_VERSION 28 #define OEM_VENDOR 29 #define HECI_DRIVER_VERSION 30 #define CODE_MAJOR_VERSION 31 #define CODE_MINOR_VERSION 32 #define CODE_HOTFIX_VERSION 33 #define CODE_BUID_VERSION 34 #define BIOS_VERSION 35 #define AMT_CODE_VERSION 36 #define AMT_MODE 37 #define AMT_MODE_1 38 #define IDS_STRING39 39 #define AMT_MODE_2 39 #define PROVISIONING_STATE 40 #define STATE_PRE 41 #define STATE_IN 42 #define STATE_POST 43 #define IDS_STRING44 44 #define PARSE_KEYWORD_DISCOVERY_TEST 44 #define DISCOVERY_PASS 45 #define IDS_STRING46 46 #define DISCOVERY_FAILED 46 #define IDS_STRING47 47 #define PARSE_KEYWORD_ACTIVATE 47 #define PARSE_KEYWORD_OTP 48 #define PARSE_KEYWORD_DNS 49 #define PARSE_KEYWORD_VERBOSE 50 #define INVALID_PARAM_INPUT 51 #define USAGE_LOCAL_AGENT 52 #define USAGE_OPTIONS 53 #define USAGE_OPTIONS_OTP 54 #define USAGE_OPTIONS_DNS 55 #define USAGE_OPTIONS_DISCOVERY 56 #define USAGE_OPTIONS_ACTIVATE 57 #define USAGE_OPTIONS_VERBOSE 58 #define WORD_ZTC 59 #define WORD_ENABLED 60 #define WORD_DISABLED 61 #define WORD_PROVISIONING_TLS_MODE 62 #define WORD_PKI 63 #define WORD_PSK 64 #define WORD_RNG_SEED_STATUS 65 #define WORD_EXIST 66 #define WORD_IN_PROGRESS 67 #define WORD_NOT_EXIST 68 #define WORD_AMT_CONFIG_ACTIVATE 69 #define WORD_SUCCESS 70 #define WORD_FAILURE 71 #define WORD_NOT_READY 72 #define HASH_ENTRY 73 #define HECI_CONNECT_TO_WD_CLIENT_FAILURE 74 #define CHANGE_TO_AMT_FAILURE 75 #define IDS_STRING76 76 #define WORD_CHANGE_TO_AMT 76 #define FOUND 77 #define CERT_HASHES_IN_FW 78 #define NO_HANDLES_FOUND 79 #define CERT_HASH 80 #define FRIENDLY_NAME 81 #define USAGE_OPTIONS_OTP_SECOND 82 ztc-3.1.0.31/src/WD_if.h0000644000175000017500000000411610662320062013156 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifndef __WD_IF_H__ #define __WD_IF_H__ #include "Types.h" #pragma pack(1) typedef struct { UINT8 Cmd; UINT8 ByteCount; UINT8 SubCmd; UINT8 Version; } STATE_INDEPNDENCE_COMMAND; typedef struct { UINT32 Enabled; } STATE_INDEPENDECE_IS_CHANGE_ENABLED_REPLY; typedef struct { UINT32 Status; } STATE_INDEPENDECE_CHANGE_TO_AMT_REPLY; #pragma pack() #endif ztc-3.1.0.31/src/heci.h0000644000175000017500000000503410662320062013076 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ #ifndef __HECI_H__ #define __HECI_H__ #include #include #ifndef GUID_DEFINED #define GUID_DEFINED #pragma pack(push,1) typedef struct guid { uint32_t data1; uint16_t data2; uint16_t data3; uint8_t data4[8]; } GUID; #pragma pack(pop) #endif class HECI { public: HECI(const GUID guid, bool verbose = false): _initialized(false), _verbose(verbose), _bufSize(0) { memcpy(&_guid, &guid, sizeof(_guid)); } virtual ~HECI() {} virtual bool Init() = 0; virtual void Deinit() = 0; virtual int ReceiveMessage(unsigned char *buffer, int len, unsigned long timeout = 2000) = 0; virtual int SendMessage(unsigned char *buffer, int len, unsigned long timeout = 2000) = 0; virtual unsigned long GetBufferSize() = 0; protected: GUID _guid; bool _initialized; bool _verbose; unsigned long _bufSize; }; #endif ztc-3.1.0.31/src/PTHICommand.cpp0000644000175000017500000020257710662320061014576 0ustar kylekyle/******************************************************************************* * Copyright (C) 2004-2007 Intel Corp. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of Intel Corp. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Intel Corp. OR THE CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *******************************************************************************/ //---------------------------------------------------------------------------- // // File: PTHICommand.cpp // //---------------------------------------------------------------------------- #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include "ZTCLocalAgent.h" #include "HECILinux.h" #include "resource.h" #include "version.h" #include "PTHICommand.h" #include "Utils.h" #include "HECI_if.h" // Define GUID used to connect to the PTHI client (via the HECI device) // {12F80028-B4B7-4B2D-ACA8-46E0FF65814C} DEFINE_GUID(HECI_PTHI_GUID,0x12F80028,0xB4B7,0x4b2d,0xAC,0xA8,0x46,0xE0,0xFF,0x65,0x81,0x4c); PTHICommand::PTHICommand( bool verbose): PTHIClient(HECI_PTHI_GUID,verbose) { } PTHICommand::~PTHICommand(void) { } /* * Confirms the correctness of the response message header * and the response message size * Arguments: * command - appropriate Host interface command * response_header - pointer to the response message header * response_size - value that holds the actual size of the * response message * expected_size - value that holds the expected size of the * response message * Return values: * AMT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ UINT32 PTHICommand::_verifyResponseHeader(const UINT32 command, const PTHI_MESSAGE_HEADER *response_header, UINT32 response_size) { UINT32 status = AMT_LOCAL_AGENT_STATUS_SUCCESS; if ( response_size != (response_header->Length + sizeof(PTHI_MESSAGE_HEADER))) { status = AMT_STATUS_INTERNAL_ERROR; } else if( response_header->Command.cmd.val != command ) { status = AMT_STATUS_INTERNAL_ERROR; } else if(response_header->Reserved != 0 ) { status = AMT_STATUS_INTERNAL_ERROR; } return status; } /* * Confirms the correctness of the GetCodeVersions response message * Arguments: * response - pointer to the response message * Return values: * AMT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ UINT32 PTHICommand::_verifyCodeVersions(const CFG_GET_CODE_VERSIONS_RESPONSE *response) { UINT32 status = AMT_STATUS_SUCCESS; UINT32 codeVerLen; UINT32 ptVerTypeCount; UINT32 len = 0; UINT32 i; do { codeVerLen = response->Header.Length - sizeof(AMT_STATUS); ptVerTypeCount = codeVerLen - sizeof(response->CodeVersions.BiosVersion)- sizeof(response->CodeVersions.VersionsCount); if ( response->CodeVersions.VersionsCount != (ptVerTypeCount/sizeof( AMT_VERSION_TYPE ))) { status = AMT_STATUS_INTERNAL_ERROR; break; } for ( i = 0; i < (response->CodeVersions.VersionsCount); i ++ ) { len = response->CodeVersions.Versions[i].Description.Length; if(len > UNICODE_STRING_LEN) { status = AMT_STATUS_INTERNAL_ERROR; break; } len = response->CodeVersions.Versions[i].Version.Length; if ( response->CodeVersions.Versions[i].Version.String[len] != '\0' || (len != strlen((PCHAR)(response->CodeVersions.Versions[i].Version.String))) ) { status = AMT_STATUS_INTERNAL_ERROR; break; } } }while ( 0 ); return status; } /* * GetVersions response message PTHI command * Arguments: * response - pointer to the CODE_VERSIONS struct * Return values: * AMT_LOCAL_AGENT_STATUS_SUCCESS - on success * AMT_STATUS_INTERNAL_ERROR - on failure */ UINT32 PTHICommand::GetCodeVersions(CODE_VERSIONS *CodeVersions) { AMT_STATUS status; UCHAR command[sizeof(GET_CODE_VERSION_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_CODE_VERSION_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; CFG_GET_CODE_VERSIONS_RESPONSE *tmp_response; PTHI_MESSAGE_HEADER *resp_header; int bytesWritten = 0; if ( CodeVersions == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_CODE_VERSION_HEADER, sizeof(GET_CODE_VERSION_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32) bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } tmp_response = (CFG_GET_CODE_VERSIONS_RESPONSE*)readBuffer; status = tmp_response->Status; if( status != AMT_STATUS_SUCCESS ) { break; } resp_header = &(tmp_response->Header); status = _verifyResponseHeader(CODE_VERSIONS_RESPONSE, resp_header,outBuffSize); if ( status != AMT_LOCAL_AGENT_STATUS_SUCCESS ) { break; } status = _verifyCodeVersions(tmp_response); if ( status != AMT_LOCAL_AGENT_STATUS_SUCCESS ) { break; } memcpy( CodeVersions,&(tmp_response->CodeVersions),sizeof(CODE_VERSIONS)) ; }while(0); if ( readBuffer != NULL ) { free(readBuffer); readBuffer = NULL; } return status; } /* * DisplayCodeVersions print code version * Arguments: * response - pointer to the CODE_VERSIONS struct * Return values: * NONE */ VOID PTHICommand::DisplayCodeVersions(const CODE_VERSIONS *versions) { UINT32 i,j; UINT16 len; // BIOS version is free format null terminated string, // max length of BIOS version string is 64 byte DisplayMessage(BIOS_VERSION); fprintf(stdout,"\t\t %s\n\n",versions->BiosVersion); DisplayMessage(AMT_CODE_VERSION); fprintf(stdout,"\n"); for ( i = 0; i < versions->VersionsCount; i ++ ) { fprintf(stdout,"\t"); len = versions->Versions[i].Description.Length; for ( j = 0; j < len; j ++ ) { fprintf(stdout,"%c",versions->Versions[i].Description.String[j]); } fprintf(stdout,":"); for ( j = 0 ; j < (UINT32)(24 - len); j ++ ) { fprintf(stdout," "); } fprintf(stdout,"%s\n", versions->Versions[i].Version.String); } fprintf(stdout,"\n"); } /* * Calls to GetProvisioningMode Host interface command * Arguments: * legacy - pointer to the pre-allocated structure * which will hold the result * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetProvisioningMode(AMT_BOOLEAN *legacy, CFG_PROVISIONING_MODE *mode) { UCHAR command[sizeof(GET_PROVISIONING_MODE_HEADER)]; UINT8 *readBuffer; UINT32 inBuffSize =0; UINT32 outBuffSize=0; int bytesWritten = 0; ULONG command_size = sizeof(GET_PROVISIONING_MODE_HEADER); AMT_STATUS status; if ( legacy == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_PROVISIONING_MODE_HEADER, sizeof(GET_PROVISIONING_MODE_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_PROVISIONING_MODE_RESPONSE *tmp_response = (CFG_GET_PROVISIONING_MODE_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(PROVISIONING_MODE_RESPONSE,resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyProvisioningMode(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } *legacy = tmp_response->LegacyMode; *mode = tmp_response->ProvisioningMode; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); readBuffer = NULL; } return status; } /* * Confirms the correctness of the GetProvisioningMode response message * Arguments: * response - pointer to the response message * Return values: * AMT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyProvisioningMode(const CFG_GET_PROVISIONING_MODE_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_PROVISIONING_MODE_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * DisplayAMTMode print legacy mode * Arguments: * *legacy - pointer to the AMT_BOOLEAN enum * Return values: * NONE */ void PTHICommand::DisplayAMTMode(const AMT_BOOLEAN *legacy) { DisplayMessage(AMT_MODE); fprintf(stdout,"\t\t\t"); if (*legacy) { DisplayMessage(AMT_MODE_1); fprintf(stdout,"\n"); } else { DisplayMessage(AMT_MODE_2); fprintf(stdout,"\n"); } } /* * Calls to GetProvisioningState Host interface command * Arguments: * state - pointer to the pre-allocated structure * which will hold the result * Return values: * PT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetProvisioningState(AMT_PROVISIONING_STATE *state) { AMT_STATUS status; UCHAR command[sizeof(GET_PROVISIONING_STATE_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_PROVISIONING_STATE_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if ( state == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_PROVISIONING_STATE_HEADER, sizeof(GET_PROVISIONING_STATE_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_PROVISIONING_STATE_RESPONSE *tmp_response = (CFG_GET_PROVISIONING_STATE_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(PROVISIONING_STATE_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyProvisioningState(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } *state = tmp_response->ProvisioningState; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetProvisioningState response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyProvisioningState(const CFG_GET_PROVISIONING_STATE_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_PROVISIONING_STATE_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * DisplayProvisioningState print provisioning state * Arguments: * *state - pointer to the AMT_PROVISIONING_STATE enum * Return values: * NONE */ VOID PTHICommand::DisplayProvisioningState(const AMT_PROVISIONING_STATE *state) { DisplayMessage(PROVISIONING_STATE); fprintf(stdout,"\t"); switch (*state) { case PROVISIONING_STATE_PRE: DisplayMessage(STATE_PRE); break; case PROVISIONING_STATE_IN: DisplayMessage(STATE_IN); break; case PROVISIONING_STATE_POST: DisplayMessage(STATE_POST); break; default: DisplayMessage(UNKNOWN); break; } fprintf(stdout,"\n"); } /* * Calls to GenerateRngKey Host interface command * Arguments: * None * Return values: * AMT_STATUS_SUCCESS - or AMT_STATUS_IN_PROGRESS on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GenerateRngKey() { AMT_STATUS status; UCHAR command[sizeof(GENERATE_RNG_SEED_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GENERATE_RNG_SEED_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; memcpy(command, &GENERATE_RNG_SEED_HEADER, sizeof(GENERATE_RNG_SEED_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GENERATE_RNG_SEED_RESPONSE *tmp_response = (CFG_GENERATE_RNG_SEED_RESPONSE*)readBuffer; status = tmp_response->Status; if( status != AMT_STATUS_SUCCESS && status!= AMT_STATUS_RNG_GENERATION_IN_PROGRESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GENERATE_RNG_SEED_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGenerateRngKey(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GenerateRngKey response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyGenerateRngKey(const CFG_GENERATE_RNG_SEED_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GENERATE_RNG_SEED_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to GetRngSeedStatus Host interface command * Arguments: * state - pointer to the pre-allocated structure * which will hold the result * Return values: * PT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetRngSeedStatus(AMT_RNG_STATUS *rngStatus) { AMT_STATUS status; UCHAR command[sizeof(GET_RNG_SEED_STATUS_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_RNG_SEED_STATUS_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if ( rngStatus == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_RNG_SEED_STATUS_HEADER, sizeof(GET_RNG_SEED_STATUS_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_RNG_SEED_STATUS_RESPONSE *tmp_response = (CFG_GET_RNG_SEED_STATUS_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_RNG_SEED_STATUS_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetRngSeedStatus(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; *rngStatus = tmp_response->RngStatus; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetRngSeedStatus response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyGetRngSeedStatus(const CFG_GET_RNG_SEED_STATUS_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_RNG_SEED_STATUS_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * DisplayRngSeedStatus print RNG seed status * Arguments: * *rngStatus - pointer to the AMT_RNG_STATUS enum * Return values: * NONE */ VOID PTHICommand::DisplayRngSeedStatus(const AMT_RNG_STATUS *rngStatus) { DisplayMessage(WORD_RNG_SEED_STATUS); fprintf(stdout,"\t"); switch (*rngStatus) { case RNG_STATUS_EXIST: DisplayMessage(WORD_EXIST); break; case RNG_STATUS_IN_PROGRESS: DisplayMessage(WORD_IN_PROGRESS); break; case RNG_STATUS_NOT_EXIST: DisplayMessage(WORD_NOT_EXIST); break; default: DisplayMessage(UNKNOWN); break; } fprintf(stdout,"\n"); } /* * Calls to ZeroTouchEnabled Host interface command * Arguments: * zeroTouchEnabled - pointer to the pre-allocated structure * which will hold the result * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetZeroTouchEnabled(AMT_BOOLEAN *zeroTouchEnabled) { AMT_STATUS status; UCHAR command[sizeof(GET_ZERO_TOUCH_ENABLED_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_ZERO_TOUCH_ENABLED_HEADER); UINT32 inBuffSize =0; UINT32 outBuffSize=0; int bytesWritten = 0; if ( zeroTouchEnabled == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_ZERO_TOUCH_ENABLED_HEADER, sizeof(GET_ZERO_TOUCH_ENABLED_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE *tmp_response = (CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_ZERO_TOUCH_ENABLED_RESPONSE,resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetZeroTouchEnabled(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } *zeroTouchEnabled = tmp_response->ZeroTouchEnabled; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); readBuffer = NULL; } return status; } /* * Confirms the correctness of the GetZeroTouchEnabled response message * Arguments: * response - pointer to the response message * Return values: * AMT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyGetZeroTouchEnabled(const CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_ZERO_TOUCH_ENABLED_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * DisplayZTCEnabled print if ZTC enabled * Arguments: * *ztcEnabled - pointer to the AMT_BOOLEAN enum * Return values: * NONE */ VOID PTHICommand::DisplayZTCEnabled(const AMT_BOOLEAN *ztcEnabled) { DisplayMessage(WORD_ZTC); fprintf(stdout,"\t\t\t"); if (*ztcEnabled) { DisplayMessage(WORD_ENABLED); fprintf(stdout,"\n"); } else { DisplayMessage(WORD_DISABLED); fprintf(stdout,"\n"); } } /* * Calls to GetProvisioningTlsMode Host interface command * Arguments: * state - pointer to the pre-allocated structure * which will hold the result * Return values: * PT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetProvisioningTlsMode(AMT_PROVISIONING_TLS_MODE *provisioningTlsMode) { AMT_STATUS status; UCHAR command[sizeof(GET_PROVISIONING_TLS_MODE_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_PROVISIONING_TLS_MODE_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if ( provisioningTlsMode == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_PROVISIONING_TLS_MODE_HEADER, sizeof(GET_PROVISIONING_TLS_MODE_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_PROVISIONING_TLS_MODE_RESPONSE *tmp_response = (CFG_GET_PROVISIONING_TLS_MODE_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_PROVISIONING_TLS_MODE_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetProvisioningTlsMode(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; *provisioningTlsMode = tmp_response->ProvisioningTlsMode; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetProvisioningTlsMode response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyGetProvisioningTlsMode(const CFG_GET_PROVISIONING_TLS_MODE_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_PROVISIONING_TLS_MODE_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * DisplayProvisioningTlsMode print provisioning TLS mode * Arguments: * *provisioningTlsMode - pointer to the AMT_PROVISIONING_TLS_MODE enum * Return values: * NONE */ VOID PTHICommand::DisplayProvisioningTlsMode(const AMT_PROVISIONING_TLS_MODE *provisioningTlsMode) { DisplayMessage(WORD_PROVISIONING_TLS_MODE); fprintf(stdout,"\t"); switch (*provisioningTlsMode) { case PKI: DisplayMessage(WORD_PKI); break; case PSK: DisplayMessage(WORD_PSK); break; case NOT_READY: DisplayMessage(WORD_NOT_READY); break; default: DisplayMessage(UNKNOWN); break; } fprintf(stdout,"\n"); } /* * Calls to StartConfiguration Host interface command * Arguments: * None * Return values: * AMT_STATUS_SUCCESS - or AMT_STATUS_CERTIFICATE_NOT_READY on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::StartConfiguration() { AMT_STATUS status; UCHAR command[sizeof(START_CONFIGURATION_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(START_CONFIGURATION_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; memcpy(command, &START_CONFIGURATION_HEADER, sizeof(START_CONFIGURATION_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_START_CONFIGURATION_RESPONSE *tmp_response = (CFG_START_CONFIGURATION_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ||status!= AMT_STATUS_CERTIFICATE_NOT_READY) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(START_CONFIGURATION_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyStartConfiguration(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the StartConfiguration response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyStartConfiguration(const CFG_START_CONFIGURATION_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_START_CONFIGURATION_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to SetProvisioningServerOTP Host interface command * Arguments: * passwordOTP AMT_ANSI_STRING structure of OTP password * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::SetProvisioningServerOTP(AMT_ANSI_STRING passwordOTP) { if ( NULL == passwordOTP.Buffer ) { return PTSDK_STATUS_INVALID_PARAM; } AMT_STATUS status; UINT32 msgLength = sizeof(passwordOTP.Length) + (passwordOTP.Length*sizeof(CHAR)); PTHI_MESSAGE_HEADER SET_PROVISIONING_SERVER_OTP_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{SET_PROVISIONING_SERVER_OTP_REQUEST},msgLength }; UINT32 command_size = sizeof(START_CONFIGURATION_HEADER) + msgLength; UCHAR *command; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &SET_PROVISIONING_SERVER_OTP_HEADER, sizeof(SET_PROVISIONING_SERVER_OTP_HEADER)); memcpy(command + sizeof(SET_PROVISIONING_SERVER_OTP_HEADER),&(passwordOTP.Length), sizeof(passwordOTP.Length)); memcpy( command + sizeof(SET_PROVISIONING_SERVER_OTP_HEADER) + sizeof(passwordOTP.Length), passwordOTP.Buffer, passwordOTP.Length); UINT8 *readBuffer; UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE *tmp_response = (CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(SET_PROVISIONING_SERVER_OTP_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifySetProvisioningServerOTP(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the SetProvisioningServerOTP response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifySetProvisioningServerOTP(const CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_SET_PROVISIONING_SERVER_OTP_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to SetDnsSuffix Host interface command * Arguments: * dnsSuffix AMT_ANSI_STRING structure of DNS suffix * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::SetDnsSuffix(AMT_ANSI_STRING dnsSuffix) { if ( NULL == dnsSuffix.Buffer ) { return PTSDK_STATUS_INVALID_PARAM; } AMT_STATUS status; UINT32 msgLength = sizeof(dnsSuffix.Length) + (dnsSuffix.Length*sizeof(CHAR)); PTHI_MESSAGE_HEADER SET_DNS_SUFFIX_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{SET_DNS_SUFFIX_REQUEST},msgLength }; UINT32 command_size = sizeof(SET_DNS_SUFFIX_HEADER) + msgLength; UCHAR *command; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &SET_DNS_SUFFIX_HEADER, sizeof(SET_DNS_SUFFIX_HEADER)); memcpy(command + sizeof(SET_DNS_SUFFIX_HEADER),&(dnsSuffix.Length), sizeof(dnsSuffix.Length)); memcpy(command + sizeof(SET_DNS_SUFFIX_HEADER) + sizeof(dnsSuffix.Length),dnsSuffix.Buffer, dnsSuffix.Length); UINT8 *readBuffer; UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_SET_DNS_SUFFIX_RESPONSE *tmp_response = (CFG_SET_DNS_SUFFIX_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(SET_DNS_SUFFIX_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifySetDnsSuffix(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the SetDnsSuffix response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifySetDnsSuffix(const CFG_SET_DNS_SUFFIX_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_SET_DNS_SUFFIX_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; //return AMT_STATUS_SUCCESS; } return AMT_STATUS_SUCCESS; } /* * Calls to EnumerateHashHandles Host interface command * Arguments: * hashHandles - pointer to the pre-allocated structure * which will hold the result * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::EnumerateHashHandles(AMT_HASH_HANDLES *hashHandles) { AMT_STATUS status; UCHAR command[sizeof(ENUMERATE_HASH_HANDLES_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(ENUMERATE_HASH_HANDLES_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if (NULL == hashHandles) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &ENUMERATE_HASH_HANDLES_HEADER, sizeof(ENUMERATE_HASH_HANDLES_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_HASH_HANDLES_RESPONSE *tmp_response = (CFG_GET_HASH_HANDLES_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(ENUMERATE_HASH_HANDLES_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyHashHandles(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } memset(hashHandles->Handles, 0, sizeof(UINT32) * CERT_HASH_MAX_NUMBER); hashHandles->Length = tmp_response->HashHandles.Length; if (CERT_HASH_MAX_NUMBER < hashHandles->Length) { status = PTSDK_STATUS_INTERNAL_ERROR; break; } memcpy(hashHandles->Handles, tmp_response->HashHandles.Handles, sizeof(UINT32) * hashHandles->Length); } while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the EnumerateHashHandles response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyHashHandles(const CFG_GET_HASH_HANDLES_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != sizeof(AMT_STATUS) + sizeof(response->HashHandles.Length) +(sizeof(UINT32) * response->HashHandles.Length)) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to GetCertificateHashEntry Host interface command * Arguments: * passwordOTP AMT_ANSI_STRING structure of DNS suffix * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetCertificateHashEntry(UINT32 hashHandle, CERTHASH_ENTRY *hashEntry) { if ( NULL == hashEntry ) { return PTSDK_STATUS_INVALID_PARAM; } AMT_STATUS status; UINT32 msgLength = sizeof(hashHandle); PTHI_MESSAGE_HEADER GET_CERTHASH_ENTRY_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{GET_CERTHASH_ENTRY_REQUEST},msgLength }; UINT32 command_size = sizeof(GET_CERTHASH_ENTRY_HEADER) + msgLength; UCHAR *command; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &GET_CERTHASH_ENTRY_HEADER, sizeof(GET_CERTHASH_ENTRY_HEADER)); memcpy(command + sizeof(GET_CERTHASH_ENTRY_HEADER),&(hashHandle), sizeof(hashHandle)); UINT8 *readBuffer; UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_CERTHASH_ENTRY_RESPONSE *tmp_response = (CFG_GET_CERTHASH_ENTRY_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_CERTHASH_ENTRY_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetCertificateHashEntry(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; hashEntry->IsActive = tmp_response->Hash.IsActive; hashEntry->IsDefault = tmp_response->Hash.IsDefault; hashEntry->Name.Length = tmp_response->Hash.Name.Length; hashEntry->HashAlgorithm = tmp_response->Hash.HashAlgorithm; memcpy(hashEntry->CertificateHash,tmp_response->Hash.CertificateHash,sizeof(tmp_response->Hash.CertificateHash)); hashEntry->Name.Buffer =(CHAR*)malloc(hashEntry->Name.Length*sizeof(CHAR)); if(NULL == hashEntry->Name.Buffer) { status = PTSDK_STATUS_INTERNAL_ERROR; break; } memcpy(hashEntry->Name.Buffer,&(tmp_response->Hash.Name.Buffer) ,hashEntry->Name.Length*sizeof(CHAR)); }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetCertificateHashEntry response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyGetCertificateHashEntry(const CFG_GET_CERTHASH_ENTRY_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_CERTHASH_ENTRY_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER) - sizeof(CHAR*)+ response->Hash.Name.Length)) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * DisplayHashEntry print Certificate Hash Entry * Arguments: * hashEntry - the CERTHASH_ENTRY struct * Return values: * NONE */ VOID PTHICommand::DisplayHashEntry(CERTHASH_ENTRY hashEntry) { char *printString; DisplayMessage(HASH_ENTRY); fprintf(stdout,"\n"); DisplayMessage(FRIENDLY_NAME); printString =(char*) malloc((hashEntry.Name.Length+1)*sizeof(CHAR)); if (NULL != printString) { memcpy(printString,hashEntry.Name.Buffer,hashEntry.Name.Length*sizeof(CHAR)); printString[hashEntry.Name.Length*sizeof(CHAR)] ='\0'; fprintf(stdout, "%s", printString); free(printString); } fprintf(stdout,"\n"); fprintf(stdout, "Default = "); fprintf(stdout, "%s\n", hashEntry.IsDefault ? "true" : "false"); fprintf(stdout, "Active = "); fprintf(stdout, "%s\n", hashEntry.IsActive ? "true" : "false"); fprintf(stdout, "Hash Algorithm = "); int len; int rows; switch(hashEntry.HashAlgorithm) { case CERT_HASH_ALGORITHM_MD5: fprintf(stdout, "MD5"); len = 16; rows = 2; break; case CERT_HASH_ALGORITHM_SHA1: fprintf(stdout, "SHA1"); len = 20; rows = 4; break; default: fprintf(stdout, "UNKNOWN"); len = 0; break; } fprintf(stdout,"\n"); //break the print into rows DisplayMessage(CERT_HASH); fprintf(stdout,"\n"); for(int j= 0; j < rows;j++) { for(int i = 0; i < len/rows; i++) { fprintf(stdout, " %02X", hashEntry.CertificateHash[j*(len/rows)+i]); } fprintf(stdout,"\n"); } } /* * Calls to GetDnsSuffix Host interface command * Arguments: * dnsSuffix - pointer to the pre-allocated structure * which will hold the result * Return values: * PT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetDnsSuffix(AMT_ANSI_STRING *dnsSuffix) { AMT_STATUS status; UCHAR command[sizeof(GET_PKI_FQDN_SUFFIX_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_PKI_FQDN_SUFFIX_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if ( dnsSuffix == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_PKI_FQDN_SUFFIX_HEADER, sizeof(GET_PKI_FQDN_SUFFIX_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_PKI_FQDN_SUFFIX_RESPONSE *tmp_response = (CFG_GET_PKI_FQDN_SUFFIX_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_PKI_FQDN_SUFFIX_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetDnsSuffix(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; dnsSuffix->Length = tmp_response->Suffix.Length; dnsSuffix->Buffer =(CHAR*)malloc(dnsSuffix->Length * sizeof(CHAR)); if(NULL == dnsSuffix->Buffer) { status = PTSDK_STATUS_INTERNAL_ERROR; break; } memcpy(dnsSuffix->Buffer,&(tmp_response->Suffix.Buffer),dnsSuffix->Length * sizeof(CHAR)); }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetDnsSuffix response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand :: _verifyGetDnsSuffix(const CFG_GET_PKI_FQDN_SUFFIX_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != sizeof(AMT_STATUS) + sizeof(response->Suffix.Length) + response->Suffix.Length*sizeof(CHAR)) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to GetAMTSetupAuditRecord Host interface command * Arguments: * auditRecord - pointer to the pre-allocated structure * which will hold the result * Return values: * PT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetAMTSetupAuditRecord(AMT_PROV_AUDIT_RECORD *auditRecord) { AMT_STATUS status; UCHAR command[sizeof(GET_AUDIT_RECORD_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_AUDIT_RECORD_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if ( auditRecord == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_AUDIT_RECORD_HEADER, sizeof(GET_AUDIT_RECORD_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_AUDIT_RECORD_RESPONSE *tmp_response = (CFG_GET_AUDIT_RECORD_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_AUDIT_RECORD_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetAMTSetupAuditRecord(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; auditRecord->ProvServerFQDN.Length = tmp_response->AuditRecord.ProvServerFQDN.Length; auditRecord->ProvServerFQDN.Buffer =(CHAR*)malloc(auditRecord->ProvServerFQDN.Length * sizeof(CHAR)); if(NULL == auditRecord->ProvServerFQDN.Buffer) { status = PTSDK_STATUS_INTERNAL_ERROR; break; } memcpy(auditRecord,&tmp_response->AuditRecord,sizeof(AMT_PROV_AUDIT_RECORD) - sizeof(AMT_ANSI_STRING)); memcpy(auditRecord->ProvServerFQDN.Buffer,&(tmp_response->AuditRecord.ProvServerFQDN.Buffer),auditRecord->ProvServerFQDN.Length * sizeof(CHAR)); }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetAMTSetupAuditRecord response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand :: _verifyGetAMTSetupAuditRecord(const CFG_GET_AUDIT_RECORD_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_AUDIT_RECORD_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER) - sizeof(AMT_ANSI_STRING) + sizeof(UINT16) + response->AuditRecord.ProvServerFQDN.Length * sizeof(CHAR))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to GetPID Host interface command * Arguments: * pid - pointer to the pre-allocated structure * which will hold the result * Return values: * PT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetPID(UINT8 *pid) { AMT_STATUS status; UCHAR command[sizeof(GET_PID_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_PID_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if ( pid == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_PID_HEADER, sizeof(GET_PID_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_PID_RESPONSE *tmp_response = (CFG_GET_PID_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_PID_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetPID(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; memcpy(pid,tmp_response->PID,sizeof(tmp_response->PID)); }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetPID response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand :: _verifyGetPID(const CFG_GET_PID_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_GET_PID_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to SetConfigurationServerFQDN Host interface command * Arguments: * confServerFQDN AMT_ANSI_STRING structure of DNS suffix * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::SetConfServerFQDN(AMT_ANSI_STRING confServerFQDN) { if ( NULL == confServerFQDN.Buffer ) { return PTSDK_STATUS_INVALID_PARAM; } AMT_STATUS status; UINT32 msgLength = sizeof(confServerFQDN.Length) + (confServerFQDN.Length*sizeof(CHAR)); PTHI_MESSAGE_HEADER SET_CONF_SERVER_FQDN_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{SET_CONF_SERVER_FQDN_REQUEST},msgLength }; UINT32 command_size = sizeof(SET_CONF_SERVER_FQDN_HEADER) + msgLength; UCHAR *command; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &SET_CONF_SERVER_FQDN_HEADER, sizeof(SET_CONF_SERVER_FQDN_HEADER)); memcpy(command + sizeof(SET_CONF_SERVER_FQDN_HEADER), &(confServerFQDN.Length), sizeof(confServerFQDN.Length)); memcpy(command + sizeof(SET_CONF_SERVER_FQDN_HEADER) + sizeof(confServerFQDN.Length), confServerFQDN.Buffer, confServerFQDN.Length); UINT8 *readBuffer; UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_SET_CONF_SERVER_FQDN_RESPONSE *tmp_response = (CFG_SET_CONF_SERVER_FQDN_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(SET_CONF_SERVER_FQDN_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifySetConfServerFQDN(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the SetConfServerFQDN response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifySetConfServerFQDN(const CFG_SET_CONF_SERVER_FQDN_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_SET_CONF_SERVER_FQDN_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to GetConfServerFQDN Host interface command * Arguments: * confServerFQDN - pointer to the pre-allocated structure * which will hold the result * Return values: * PT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::GetConfServerFQDN(AMT_ANSI_STRING *confServerFQDN) { AMT_STATUS status; UCHAR command[sizeof(GET_CONF_SERVER_FQDN_HEADER)]; UINT8 *readBuffer; UINT32 command_size = sizeof(GET_CONF_SERVER_FQDN_HEADER); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; if ( confServerFQDN == NULL ) { return PTSDK_STATUS_INVALID_PARAM; } memcpy(command, &GET_CONF_SERVER_FQDN_HEADER, sizeof(GET_CONF_SERVER_FQDN_HEADER)); bytesWritten = PTHIClient.SendMessage(command,command_size); if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_GET_CONF_SERVER_FQDN_RESPONSE *tmp_response = (CFG_GET_CONF_SERVER_FQDN_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(GET_CONF_SERVER_FQDN_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyGetConfServerFQDN(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; confServerFQDN->Length = tmp_response->FQDN.Length; confServerFQDN->Buffer =(CHAR*)malloc(confServerFQDN->Length * sizeof(CHAR)); if(NULL == confServerFQDN->Buffer) { status = PTSDK_STATUS_INTERNAL_ERROR; break; } memcpy(confServerFQDN->Buffer,&(tmp_response->FQDN.Buffer),confServerFQDN->Length * sizeof(CHAR)); }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the GetConfServerFQDN response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand :: _verifyGetConfServerFQDN(const CFG_GET_CONF_SERVER_FQDN_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != sizeof(AMT_STATUS) + sizeof(response->FQDN.Length) + response->FQDN.Length*sizeof(CHAR)) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to SetCertificateHashState Host interface command * Arguments: * handle Reference handle to the certificate entry * isActive Indicates whether this certificate active for provisioning. * FALSE – not active; TRUE – active. * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::SetCertificateHashState(UINT32 handle , AMT_BOOLEAN isActive ) { AMT_STATUS status; UCHAR *command; UINT8 *readBuffer; UINT32 command_size = sizeof(CFG_SET_CERTHASH_STATE_REQUEST); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &SET_CERTHASH_STATE_HEADER, sizeof(SET_CERTHASH_STATE_HEADER)); memcpy(command + sizeof(SET_CERTHASH_STATE_HEADER), &(handle), sizeof(handle)); memcpy(command + sizeof(SET_CERTHASH_STATE_HEADER) + sizeof(handle), &(isActive), sizeof(isActive)); bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_SET_CERTHASH_STATE_RESPONSE *tmp_response = (CFG_SET_CERTHASH_STATE_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(SET_CERTHASH_STATE_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifySetCertificateHashState(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the SetCertificateHashState response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifySetCertificateHashState(const CFG_SET_CERTHASH_STATE_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_SET_CERTHASH_STATE_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to SetConfigurationServerFQDN Host interface command * Arguments: * isDefault Is this a default certificate or not. FALSE – not a default; TRUE – default. * isDefault Indicates whether this certificate active for provisioning. FALSE – not active; TRUE – active. * certificateHash Hashed certificate. * name ASCII char set, contains certificate friendly name which is up to 32 bytes. * handle The new certificate handle in AMT data base.(OUT) * * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::AddCertificateHashEntry( AMT_BOOLEAN isDefault, AMT_BOOLEAN isActive, UINT8 certificateHash[20], AMT_ANSI_STRING name , UINT32 *handle) { if ( NULL == name.Buffer ) { return PTSDK_STATUS_INVALID_PARAM; } AMT_STATUS status; UINT32 msgLength =sizeof(isDefault) + sizeof(isActive) + sizeof(UINT8)*20 + sizeof(name.Length) + (name.Length*sizeof(CHAR)); PTHI_MESSAGE_HEADER ADD_CERTHASH_ENTRY_HEADER = { {AMT_MAJOR_VERSION,AMT_MINOR_VERSION},0,{ADD_CERTHASH_ENTRY_REQUEST},msgLength }; UINT32 command_size = sizeof(ADD_CERTHASH_ENTRY_HEADER) + msgLength; UCHAR *command; UINT8 *readBuffer; UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &ADD_CERTHASH_ENTRY_HEADER, sizeof(ADD_CERTHASH_ENTRY_HEADER)); memcpy(command + sizeof(ADD_CERTHASH_ENTRY_HEADER),&(isDefault), sizeof(isDefault)); memcpy(command + sizeof(ADD_CERTHASH_ENTRY_HEADER) + sizeof(isDefault), &(isActive), sizeof(isActive)); memcpy(command + sizeof(ADD_CERTHASH_ENTRY_HEADER) + sizeof(isDefault) + sizeof(isActive), certificateHash, sizeof(UINT8)* 20); memcpy(command + sizeof(ADD_CERTHASH_ENTRY_HEADER) + sizeof(isDefault) + sizeof(isActive) + sizeof(UINT8)* 20,&(name.Length), sizeof(name.Length)); memcpy(command + sizeof(ADD_CERTHASH_ENTRY_HEADER) + sizeof(isDefault) + sizeof(isActive) + sizeof(UINT8)* 20 + sizeof(name.Length), name.Buffer, name.Length); bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_ADD_CERTHASH_ENTRY_RESPONSE *tmp_response = (CFG_ADD_CERTHASH_ENTRY_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(ADD_CERTHASH_ENTRY_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyAddCertificateHashEntry(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; memcpy(handle,&(tmp_response->Handle),sizeof(tmp_response->Handle)); }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the AddCertificateHashEntry response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyAddCertificateHashEntry(const CFG_ADD_CERTHASH_ENTRY_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_ADD_CERTHASH_ENTRY_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to DeleteCustomizedCertificateHashEntry Host interface command * Arguments: * handle Reference handle to the certificate entry * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::DeleteCustomizedCertificateHashEntry(UINT32 handle) { AMT_STATUS status; UCHAR *command; UINT8 *readBuffer; UINT32 command_size = sizeof(CFG_DELETE_CERTHASH_ENTRY_REQUEST); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &DELETE_CERTHASH_ENTRY_HEADER, sizeof(DELETE_CERTHASH_ENTRY_HEADER)); memcpy(command + sizeof(DELETE_CERTHASH_ENTRY_HEADER), &(handle), sizeof(handle)); bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_DELETE_CERTHASH_ENTRY_RESPONSE *tmp_response = (CFG_DELETE_CERTHASH_ENTRY_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(DELETE_CERTHASH_ENTRY_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifyDeleteCertificateHashEntry(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the DeleteCustomizedCertificateHashEntry response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifyDeleteCertificateHashEntry(const CFG_DELETE_CERTHASH_ENTRY_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_DELETE_CERTHASH_ENTRY_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } /* * Calls to SetZeroTouchEnabled Host interface command * Arguments: * mode False – ZTC disabled, True- ZTC enabled. * Return values: * AMT_STATUS_SUCCESS - on success * appropriate error value defined in StatusCodeDefinitions.h - on failure */ AMT_STATUS PTHICommand::SetZeroTouchEnabled( AMT_BOOLEAN mode ) { AMT_STATUS status; UCHAR *command; UINT8 *readBuffer; UINT32 command_size = sizeof(CFG_SET_ZTC_MODE_REQUEST); UINT32 inBuffSize; UINT32 outBuffSize=0; int bytesWritten = 0; command = (UCHAR*) malloc(command_size); if(NULL == command) { return PTSDK_STATUS_INTERNAL_ERROR; } memcpy(command, &SET_ZTC_MODE_HEADER, sizeof(SET_ZTC_MODE_HEADER)); memcpy(command + sizeof(SET_ZTC_MODE_HEADER), &(mode), sizeof(mode)); bytesWritten = PTHIClient.SendMessage(command,command_size); if ( command != NULL ) { free(command); } if((UINT32)bytesWritten != command_size) { return AMT_STATUS_INTERNAL_ERROR; } inBuffSize = PTHIClient.GetBufferSize(); readBuffer = (UINT8*) malloc (sizeof(UINT8) * inBuffSize); if(NULL == readBuffer) { return PTSDK_STATUS_INTERNAL_ERROR; } memset(readBuffer,0,inBuffSize); outBuffSize = PTHIClient.ReceiveMessage(readBuffer,inBuffSize); do { if( 0 == outBuffSize) { status = AMT_STATUS_INTERNAL_ERROR; break; } CFG_SET_ZTC_MODE_RESPONSE *tmp_response = (CFG_SET_ZTC_MODE_RESPONSE*)readBuffer; status = tmp_response->Status; if ( status != AMT_STATUS_SUCCESS ) { break; } PTHI_MESSAGE_HEADER *resp_header = &(tmp_response->Header); status = _verifyResponseHeader(SET_ZTC_MODE_RESPONSE, resp_header,outBuffSize); if ( status != AMT_STATUS_SUCCESS ) { break; } status = _verifySetZeroTouchEnabled(tmp_response); if ( status != AMT_STATUS_SUCCESS ) { break; } status = tmp_response->Status; }while ( 0 ); if ( readBuffer != NULL ) { free(readBuffer); } return status; } /* * Confirms the correctness of the SetZeroTouchEnabled response message * Arguments: * response - pointer to the response message * Return values: * PT_STATUS_SUCCESS - on success * PTSDK_STATUS_INTERNAL_ERROR - on failure */ AMT_STATUS PTHICommand::_verifySetZeroTouchEnabled(const CFG_SET_ZTC_MODE_RESPONSE *response) { ULONG ByteCount; ByteCount = response->Header.Length; if (ByteCount != (sizeof(CFG_SET_ZTC_MODE_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER))) { return PTSDK_STATUS_INTERNAL_ERROR; } return AMT_STATUS_SUCCESS; } ztc-3.1.0.31/configure.ac0000644000175000017500000000126410662320061013514 0ustar kylekyleAC_PREREQ(2.59) AC_INIT([ZTC], [3.1], [www.intel.com]) AC_CONFIG_SRCDIR([src/ZTCLocalAgent.cpp]) AM_INIT_AUTOMAKE([1.9 foreign]) AC_CONFIG_HEADER([config.h]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CPP # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([fcntl.h memory.h stdint.h stdlib.h string.h strings.h sys/ioctl.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_SELECT_ARGTYPES AC_CHECK_FUNCS([memset select strchr strrchr]) AC_CONFIG_FILES([src/Makefile Makefile]) AC_OUTPUT ztc-3.1.0.31/aclocal.m40000644000175000017500000007462010662320061013074 0ustar kylekyle# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # 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 7 # 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_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # 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 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl 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], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # 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. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # 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_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # 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 # 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. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # 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 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 # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. 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], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # 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 # 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. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], 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 ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 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], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 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_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # 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_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 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_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 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_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # 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_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # 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 test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 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'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} 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. _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 # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR ztc-3.1.0.31/INSTALL0000644000175000017500000000000110662320061012243 0ustar kylekyle