[
  {
    "path": ".gitignore",
    "content": "# Object files\n*.o\n*.obj\n\n# Libraries\n*.lib\n*.a\n\n# Shared objects (inc. Windows DLLs)\n*.dll\n*.so\n*.so.*\n*.dylib\n\n# build products\npgreplay\npgreplay.exe\nMakefile\nconfig.h\nconfig.log\nconfig.status\n\n# test subdirectory\ntest/\n\n# other versioning systems\n.svn\nCVS\n\n# M4 cache\nautom4te.cache/\n"
  },
  {
    "path": "CHANGELOG",
    "content": "Version 1.4.0\n\nEnhancements:\n- Add a replay option \"-n\" that provides a \"dry run\" without actually\n  connecting to the database.\n  Patch by Manuel Vives.\n\nBugfixes:\n- Fix Makefile to call \"install\" portably.\n  It used to call \"$(INSTALL) -D\", which works on some, but not all systems\n  (MAC OS X is an example where it doesn't work).\n  Report by Jeff Doering.\n- Fix crash after replay of DEALLOCATE ALL.\n  This caused a crash the next time prepared statements were deleted, for\n  example at the end of the database session.\n  Reported by Wan Shen Lim.\n\nVersion 1.3.0  Feb 20 2017\n\nEnhancements:\n- Accept CPPFLAGS from configure in Makefile.in.\n  Patch by Marko Kreen.\n- Add command line option -X to specify extra connect string fragment.\n  Needed to specify unusual connect string options.\n  Patch by Marko Kreen.\n- Introduce replay filter options with \"-D database\" and \"-U username\"\n  to filter for a database or user during parsing.\n  Patch by Gilles Darold.\n\nVersion 1.2.0  Aug 17 2012\n\nEnhancements:\n- Introduce replay option \"-j\" to jump ahead when all connections are idle.\n  This can speed up replay.  The statistics will not include the skipped time,\n  but delay warnings will work as expected.\n  Idea and original patch by John Lumby.\n\nBugfixes:\n- Fix failure to parse string constants like E'\\\\' where the backslash before\n  a quotation mark is backslash-quoted.\n  Bug discovered by Jeff Frost.\n\nVersion 1.1.0  Feb 09 2012\n\nEnhancements:\n- Respect environment variable DESTDIR in Makefile for RPM packagers.\n- Improve execution delay reporting by introducing more intelligent time\n  steps when a report is written; every 10 seconds is way too spammy.\n- Add documentation for interaction with pgFouine to the README.\n\nBugfixes:\n- Fix incorrect assumption that everything that starts with a dollar\n  sign is a dollar quoted string.  This used to trigger bogus \"end of dollar\n  quote not found\" error messages when $n placeholders are used in PREPARE\n  statements.  Discovered and fixed by Todd Owen.\n- When pgreplay waited for a response on a connection because it needed to\n  send the next command, it used to sleep for one millisecond before\n  polling the socket again.  This proved to be too long on busy systems,\n  where replay started to lag behind.  Now pgreplay will not sleep,\n  but keep polling until the response is there.\n\nVersion 1.0.0  Jun 03 2011\n\nBugfixes:\n- Fix a connection and memory leak introduced by the new handling of FATAL\n  connection errors in 0.9.1.\n  Discovered by Denis Kostin.\n\nVersion 0.9.1  Feb 26 2011\n\nEnhancements:\n- Calculate parse and execution statistics and display them at the end\n  of the run.\n\nBugfixes:\n- Use \"=\" instead of \"==\" in \"test\" comparisons in configure.\n  This improves portability.\n- Change replay file timestamp to seconds after midnight of 2000-01-01\n  in local time.  This makes the replay file format independent of time zones \n  and avoids problems with mktime(3) implementations that don't like\n  the UNIX epoch.\n- Ignore string literals in filter_bad_statements during log file parsing.\n  This keeps the function from getting confused by the contents of the\n  string.  Discovered by Josh Berkus.\n- Correctly handle prepared statements without parameters.\n  Discovered by Grigorij Lipin.\n- Fix a corner case bug in read_log_line that can cause data corruption\n  when parsing a stderr log.  Discovered by Grigorij Lipin.\n- Skip memory dumps in stderr log caused by \"out of memory\" errors\n  instead of gagging on them.  Discovered by Grigorij Lipin.\n- Don't gag if a connection attempt results in a FATAL error during replay.\n  This can for example happen if max_connections has been exceeded or if a\n  non-existant user is specified with \"trust\" authentication.\n  Discovered by Grigorij Lipin.\n\nVersion 0.9.0  Mar 19 2010\n\n- first release\n"
  },
  {
    "path": "Dockerfile",
    "content": "FROM ubuntu:22.04\n\nRUN TZ=UTC\nRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone\nRUN apt-get update && \\\n    apt-get install --no-install-recommends -y tzdata make gcc libc6-dev postgresql-14 libpq-dev postgresql-doc-14 git ca-certificates && \\\n    apt-get clean && rm -rf /var/lib/apt/lists/*\n\nWORKDIR /root\nRUN git clone https://github.com/laurenz/pgreplay.git\nWORKDIR /root/pgreplay\nRUN ./configure --with-postgres=/usr/bin\nRUN make\nRUN make install\nRUN ln -s /root/pgreplay/pgreplay /usr/local/bin\n\n"
  },
  {
    "path": "Formula/pgreplay.rb",
    "content": "class Pgreplay < Formula\n  desc \"Record and replay real-life PostgreSQL workloads\"\n  homepage \"https://github.com/laurenz/pgreplay\"\n  url \"https://github.com/laurenz/pgreplay/archive/refs/tags/PGREPLAY_1_3_0.tar.gz\"\n  sha256 \"ff1d67d568df5a23c0ba79b74d7870f0f8711683cda8b9e0a1fafd18c2f33409\"\n  license \"MIT\"\n  head \"https://github.com/laurenz/pgreplay.git\", branch: \"master\"\n\n  livecheck do\n    url :stable\n    strategy :github_latest\n  end\n\n  depends_on \"postgresql\"\n\n  def install\n    pg_config = Formula[\"postgresql\"].opt_bin/\"pg_config\"\n    libdir = Utils.safe_popen_read(pg_config, \"--libdir\").strip\n    includedir = Utils.safe_popen_read(pg_config, \"--includedir\").strip\n\n    ENV.append \"LDFLAGS\", \"-L#{libdir}\"\n    ENV.append \"CPPFLAGS\", \"-I#{includedir}\"\n\n    system \"./configure\", \"--prefix=#{prefix}\", \"--with-postgres=#{pg_config.dirname}\"\n\n    inreplace \"Makefile\" do |s|\n      s.gsub! \"-D -m 0755\", \"-m 0755\"\n      s.gsub! \"-D -m 0644\", \"-m 0644\"\n    end\n\n    bin.mkpath\n    man1.mkpath\n\n    system \"make\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    assert_match version.to_s, shell_output(\"#{bin}/pgreplay -v\")\n  end\nend\n"
  },
  {
    "path": "LICENSE",
    "content": "Portions Copyright (c) 2017-2023, CYBERTEC PostgreSQL International GmbH\nPortions Copyright (c) 2010-2017, Magistrat der Stadt Wien\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose, without fee, and without a written agreement\nis hereby granted, provided that the above copyright notice and this paragraph\nand the following two paragraphs appear in all copies.\n\nIN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR\nDIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING\nLOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,\nEVEN IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n\nTHE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,\nBUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN \"AS IS\" BASIS,\nAND THE COPYRIGHT HOLDER HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,\nSUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n"
  },
  {
    "path": "Makefile.in",
    "content": "CFLAGS = @CFLAGS@\nCPPFLAGS = @CPPFLAGS@\nLDFLAGS = @LDFLAGS@\nLIBS = @LIBS@\nCC = @CC@\nEXTRA_OBJS = @EXTRA_OBJS@\nprefix = @prefix@\nexec_prefix = @exec_prefix@\nbindir = @bindir@\ndatarootdir = @datarootdir@\ndatadir = @datadir@\nmandir = @mandir@\ndocdir = @docdir@\nhtmldir = @htmldir@\nINSTALL = @INSTALL@\nVERSION = @PACKAGE_VERSION@\nEXE = pgreplay\nOBJS = parse.o replayitem.o main.o replayfile.o database.o $(EXTRA_OBJS)\nHEADERS = config.h pgreplay.h\n\n.PHONY: clean distclean tarball test install install_bin install_man install_html\n\n.SUFFIXES: .o .c .h\n\n$(EXE): $(OBJS) $(HEADERS)\n\t$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(OBJS) $(LDFLAGS) $(LIBS)\n\n$(OBJS): $(HEADERS)\n\nclean:\n\trm -f $(OBJS) $(EXE)\n\ndistclean: clean\n\trm -rf Makefile config.h config.h.in~ config.log config.cache config.status autom4te.cache test/runtest.sh pgreplay-$(VERSION).tar*\n\ntarball: distclean\n\tif tar --version 2>/dev/null | grep -q GNU; then : ;else echo \"this requires GNU tar\" 1>&2; exit 1; fi\n\tln -s \"`pwd`\" /tmp/pgreplay-$(VERSION)\n\ttar -cf pgreplay-$(VERSION).tar -h -C /tmp --exclude .svn --exclude CVS --exclude pgreplay-$(VERSION).tar pgreplay-$(VERSION) --exclude test/testrun.c\n\trm /tmp/pgreplay-$(VERSION)\n\tgzip -9 pgreplay-$(VERSION).tar\n\n$(EXE).html: $(EXE).1\n\tgroff -Thtml -mman $< > $@\n\ntest: $(EXE) test/runtest.sh\n\tcd test && ./runtest.sh\n\ninstall: install_bin install_man\n\ninstall_bin: $(EXE)\n\t$(INSTALL) -d $(DESTDIR)$(bindir)\n\t$(INSTALL) -m 0755 $< $(DESTDIR)$(bindir)/$<\n\ninstall_man: $(EXE).1\n\t$(INSTALL) -d $(DESTDIR)$(mandir)/man1\n\t$(INSTALL) -m 0644 $< $(DESTDIR)$(mandir)/man1/$<\n\ninstall_html: $(EXE).html\n\t$(INSTALL) -d $(DESTDIR)$(htmldir)\n\t$(INSTALL) -m 0644 $< $(DESTDIR)$(htmldir)/$<\n\n.c.o:\n\t$(CC) -c $(CPPFLAGS) $(CFLAGS) -DVERSION='\"$(VERSION)\"' $<\n"
  },
  {
    "path": "README.md",
    "content": "pgreplay - record and replay real-life database workloads\n=========================================================\n\npgreplay reads a PostgreSQL log file (*not* a WAL file), extracts the\nSQL statements and executes them in the same order and with the original\ntiming against a PostgreSQL database.\n\nIf the execution of statements gets behind schedule, warning messages\nare issued that indicate that the server cannot handle the load in a\ntimely fashion.\n\nA final report gives you a useful statistical analysis of your workload\nand its execution.\n\nThe idea is to replay a real-world database workload as exactly as possible.\n\nThis is useful for performance tests, particularly in the following\nsituations:\n- You want to compare the performance of your PostgreSQL application\n  on different hardware or different operating systems.\n- You want to upgrade your database and want to make sure that the new\n  database version does not suffer from performance regressions that\n  affect you.\n\nMoreover, pgreplay can give you some feeling as to how your application\n*might* scale by allowing you to try to replay the workload at a higher\nspeed (if that is possible; see\n[implementation details](#implementation-details) below).\nBe warned, though, that 500 users working at double speed is not really\nthe same as 1000 users working at normal speed.\n\nWhile pgreplay will find out if your database application will encounter\nperformance problems, it does not provide a lot of help in the analysis of\nthe cause of these problems.  Combine pgreplay with a specialized analysis\nprogram like [pgBadger](https://pgbadger.darold.net/) for that.\n\nAs an additional feature, pgreplay lets you split the replay in two\nparts: you can parse the log file and create a \"replay file\", which\ncontains just the statements to be replayed and is hopefully much\nsmaller than the original log file.  \nSuch a replay file can then be run against a database.\n\npgreplay is written by Laurenz Albe and is inspired by \"Playr\"\nwhich never made it out of Beta.\n\nInstallation\n============\n\npgreplay needs PostgreSQL 8.0 or better.\n\nIt is supposed to compile without warnings and run on all platforms\nsupported by PostgreSQL.  \nSince I only got to test it on Linux, AIX, FreeBSD and Windows, there may be\nproblems with other platforms. I am interested in reports and fixes for\nthese platforms.  \nOn Windows, only the MinGW build environment is supported (I have no\nother compiler). That means that there is currently no 64-bit build\nfor Windows (but a 32-bit executable should work fine anywhere).\n\nTo build pgreplay, you will need the `pg_config` utility. If you installed\nPostgreSQL using installation packages, you will probably have to install\nthe development package that contains `pg_config` and the header files.\n\nIf `pg_config` is on the `PATH`, the installation process will look like this:\n\n- unpack the tarball\n- `./configure`\n- `make`\n- `make test`     (optional, described below)\n- `make install`  (as superuser)\n\nIf your PostgreSQL installation is in a nonstandard directory, you\nwill have to use the `--with-postgres=<path to location of pg_config>`\noption of `configure`.\n\nUnless you link it statically, pgreplay requires the PostgreSQL client \nshared library on the system where it is run.\n\nThe following utilities are only necessary if you intend to develop pgreplay:\n- autoconf 2.62 or better to generate `configure`\n- GNU tar to `make tarball` (unless you want to roll it by hand)\n- groff to make the HTML documentation with `make html`\n\nHomebrew (macOS)\n----------------\n\nYou can install pgreplay via Homebrew using this repository as a tap:\n\n```\nbrew tap laurenz/pgreplay https://github.com/laurenz/pgreplay\nbrew install laurenz/pgreplay/pgreplay\n```\n\nAfter installation, verify the binary with `pgreplay -v`.\n\nDocker\n------\n\nThe `Dockerfile` provided with the software can be used as a starting\npoint for creating a container that runs pgreplay.  Adapt is as necessary.\n\nHere are commands to build and run the container:\n\n```\n# build the image\ndocker build -t laurenz/pgreplay -f Dockerfile .\n\n# and run it\ndocker run --rm -ti -v $(pwd):/app -w /app laurenz/pgreplay pgreplay -h\n```\n\nTesting\n-------\n\nYou can run a test on pgreplay before installing by running `make test`.\nThis will parse sample log files and check that the result is as\nexpected.\n\nThen an attempt is made to replay the log files and check if that\nworks as expected.  For this you need psql installed and a PostgreSQL server\nrunning (on this or another machine) so that the following command\nwill succeed:\n\n    psql -U postgres -d postgres -l\n\nYou can set up the `PGPORT` and `PGHOST` environment variables and a password\nfile for the user if necessary.\n\nThere have to be a login roles named `hansi` and `postgres` in the database,\nand both users must be able to connect without a password.  Only `postgres`\nwill be used to run actual SQL statements.  The regression test will create\na table `runtest` and use it, and it will drop the table when it is done.\n\nUsage\n=====\n\nFirst, you will need to record your real-life workload.\nFor that, set the following parameters in `postgresql.conf`:\n\n- `log_min_messages = error`  (or more)  \n   (if you know that you have no cancel requests, `log` will do)\n- `log_min_error_statement = log`  (or more)\n- `log_connections = on`\n- `log_disconnections = on`\n- `log_line_prefix = '%m|%u|%d|%c|'`  (if you don't use CSV logging)\n- `log_statement = 'all'`\n- `lc_messages` must be set to English (the encoding does not matter)\n- `bytea_output = escape`  (from version 9.0 on, only if you want to replay\n                            the log on 8.4 or earlier)\n\nIt is highly recommended that you use CSV logging, because anything that\nthe PostgreSQL server or any loaded modules write to standard error will\nbe written to the stderr log and might confuse the parser.\n\nThen let your users have their way with the database.\n\nMake sure that you have a `pg_dumpall` of the database cluster from the time\nof the start of your log file (or use the `-b` option with the time of your\nbackup).  Alternatively, you can use point-in-time-recovery to clone your\ndatabase at the appropriate time.\n\nWhen you are done, restore the database (in the \"before\" state) to the\nmachine where you want to perform the load test and run pgreplay against\nthat database.\n\nTry to create a scenario as similar to your production system as\npossible (except for the change you want to test, of course).  For example,\nif your clients connect over the network, run pgreplay on a different\nmachine from where the database server is running.\n\nSince passwords are not logged (and pgreplay consequently has no way of\nknowing them), you have two options: either change `pg_hba.conf` on the\ntest database to allow `trust` authentication or (if that is unacceptable)\ncreate a password file as described by the PostgreSQL documentation.\nAlternatively, you can change the passwords of all application users\nto one single password that you supply to pgreplay with the `-W` option.\n\nLimitations\n===========\n\npgreplay can only replay what is logged by PostgreSQL.\nThis leads to some limitations:\n\n- `COPY` statements will not be replayed, because the copy data are not logged.\n  I could have supported `COPY TO` statements, but that would have imposed a\n  requirement that the directory structure on the replay system must be\n  identical to the original machine.\n  And if your application runs on the same machine as your database and they\n  interact on the file system, pgreplay will probably not help you much\n  anyway.\n- Fast-path API function calls are not logged and will not be replayed.\n  Unfortunately, this includes the Large Object API.\n- Since the log file is always written in the database encoding (which you\n  can specify with the `-E` switch of pgreplay), all `SET client_encoding`\n  statements will be ignored.\n- If your cluster contains databases with different encoding, the log file\n  will have mixed encoding as well.  You cannot use pgreplay well in such\n  an environment, because many statements against databases whose\n  encoding does not match the `-E` switch will fail.\n- Since the preparation time of prepared statements is not logged (unless\n  `log_min_messages` is `debug2` or more), these statements will be prepared\n  immediately before they are first executed during replay.\n- All parameters of prepared statements are logged as strings, no matter\n  what type was originally specified during bind.\n  This can cause errors during replay with expressions like `$1 + $2`,\n  which will cause the error `operator is not unique: unknown + unknown`.\n\nWhile pgreplay makes sure that commands are sent to the server in the\norder in which they were originally executed, there is no way to guarantee\nthat they will be executed in the same order during replay:  Network\ndelay, processor contention and other factors may cause a later command\nto \"overtake\" an earlier one.  While this does not matter if the\ncommands don't affect each other, it can lead to SQL statements hitting\nlocks unexpectedly, causing replay to deadlock and \"hang\".\nThis is particularly likely if many different sessions change the same data\nrepeatedly in short intervals.\n\nYou can work around this problem by canceling the waiting statement with\npg_cancel_backend.  Replay should continue normally after that.\n\nImplementation details\n======================\n\npgreplay will track the \"session ID\" associated with each log entry (the\nsession ID uniquely identifies a database connection).\nFor each new session ID, a new database connection will be opened during\nreplay.  Each statement will be sent on the corresponding connection, so\ntransactions are preserved and concurrent sessions cannot get in each\nother's way.\n\nThe order of statements in the log file is strictly preserved, so there\ncannot be any race conditions caused by different execution speeds on\nseparate connections.  On the other hand, that means that long running\nqueries on one connection may stall execution on concurrent connections,\nbut that's all you can get if you want to reproduce the exact same\nworkload on a system that behaves differently.\n\nAs an example, consider this (simplified) log file:\n\n    session 1|connect\n    session 2|connect\n    session 1|statement: BEGIN\n    session 1|statement: SELECT something(1)\n    session 2|statement: BEGIN\n    session 2|statement: SELECT something(2)\n    session 1|statement: SELECT something(3)\n    session 2|statement: ROLLBACK\n    session 2|disconnect\n    session 1|statement: COMMIT\n    session 2|disconnect\n\nThis will cause two database connections to be opened, so the `ROLLBACK` in\nsession 2 will not affect session 1.\nIf `SELECT something(2)` takes longer than expected (longer than it did in\nthe original), that will not stall the execution of `SELECT something(3)`\nbecause it runs on a different connection.  The `ROLLBACK`, however, has to\nwait for the completion of the long statement.  Since the order of statements\nis preserved, the `COMMIT` on session 1 will have to wait until the `ROLLBACK`\non session 2 has started (but it does not have to wait for the completion of\nthe `ROLLBACK`).\n\npgreplay is implemented in C and makes heavy use of asynchronous command\nprocessing (which is the reason why it is implemented in C).\nThis way a single process can handle many concurrent connections, which\nmakes it possible to get away without multithreading or multiprocessing.\n\nThis avoids the need for synchronization and many portability problems.\nBut since TINSTAAFL, the choice of C brings along its own portability\nproblems.  Go figure.\n\nReplay file format\n------------------\n\nThe replay file is a binary file, integer numbers are stored in network\nbyte order.\n\nEach record in the replay file corresponds to one database operation\nand is constructed as follows:\n- 4-byte `unsigned int`: log file timestamp in seconds since 2000-01-01\n- 4-byte `unsigned int`: fractional part of log file timestamp in microseconds\n- 8-byte `unsigned int`: session id\n- 1-byte `unsigned int`: type of the database action:\n  - 0 is connect\n  - 1 is disconnect\n  - 2 is simple statement execution\n  - 3 is statement preparation\n  - 4 is execution of a prepared statement\n  - 5 is cancel request\n- The remainder of the record is specific to the action, strings are stored\n  with a preceeding 4-byte unsigned int that contains the length.\n  Read the source for details.\n- Each record is terminated by a new-line character (byte 0x0A).\n\nSupport\n=======\n\nIf you have a problem or question, the preferred option is to [open an\nissue](https://github.com/laurenz/pgreplay/issues).\nThis requires a GitHub account.\n\nProfessional support can be bought from\n[CYBERTEC PostgreSQL International GmbH](https://www.cybertec-postgresql.com/).\n\nTODO list\n=========\n\nNothing currently.  Tell me if you have good ideas.\n"
  },
  {
    "path": "TODO",
    "content": "This is a list of things that could be improved.\nHelp is welcome!\n\n- Use \"single-row mode\" with PQsetSingleRowMode.\n  This would reduce the memory requirements for large result sets.\n\n  Noted by Thomas Dziedzic in #15.\n"
  },
  {
    "path": "config.guess",
    "content": "#! /bin/sh\n# Attempt to guess a canonical system name.\n#   Copyright 1992-2017 Free Software Foundation, Inc.\n\ntimestamp='2017-11-07'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <https://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n#\n# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.\n#\n# You can get the latest version of this script from:\n# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\n#\n# Please send patches to <config-patches@gnu.org>.\n\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION]\n\nOutput the configuration name of the system \\`$me' is run on.\n\nOptions:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.guess ($timestamp)\n\nOriginally written by Per Bothner.\nCopyright 1992-2017 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\" >&2\n       exit 1 ;;\n    * )\n       break ;;\n  esac\ndone\n\nif test $# != 0; then\n  echo \"$me: too many arguments$help\" >&2\n  exit 1\nfi\n\ntrap 'exit 1' 1 2 15\n\n# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n# compiler to aid in system detection is discouraged as it requires\n# temporary files to be created and, as you can see below, it is a\n# headache to deal with in a portable fashion.\n\n# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still\n# use `HOST_CC' if defined, but it is deprecated.\n\n# Portable tmp directory creation inspired by the Autoconf team.\n\nset_cc_for_build='\ntrap \"exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode\" 0 ;\ntrap \"rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1\" 1 2 13 15 ;\n: ${TMPDIR=/tmp} ;\n { tmp=`(umask 077 && mktemp -d \"$TMPDIR/cgXXXXXX\") 2>/dev/null` && test -n \"$tmp\" && test -d \"$tmp\" ; } ||\n { test -n \"$RANDOM\" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||\n { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo \"Warning: creating insecure temp directory\" >&2 ; } ||\n { echo \"$me: cannot create a temporary directory in $TMPDIR\" >&2 ; exit 1 ; } ;\ndummy=$tmp/dummy ;\ntmpfiles=\"$dummy.c $dummy.o $dummy.rel $dummy\" ;\ncase $CC_FOR_BUILD,$HOST_CC,$CC in\n ,,)    echo \"int x;\" > $dummy.c ;\n\tfor c in cc gcc c89 c99 ; do\n\t  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then\n\t     CC_FOR_BUILD=\"$c\"; break ;\n\t  fi ;\n\tdone ;\n\tif test x\"$CC_FOR_BUILD\" = x ; then\n\t  CC_FOR_BUILD=no_compiler_found ;\n\tfi\n\t;;\n ,,*)   CC_FOR_BUILD=$CC ;;\n ,*,*)  CC_FOR_BUILD=$HOST_CC ;;\nesac ; set_cc_for_build= ;'\n\n# This is needed to find uname on a Pyramid OSx when run in the BSD universe.\n# (ghazi@noc.rutgers.edu 1994-08-24)\nif (test -f /.attbin/uname) >/dev/null 2>&1 ; then\n\tPATH=$PATH:/.attbin ; export PATH\nfi\n\nUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown\nUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown\nUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown\nUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown\n\ncase \"${UNAME_SYSTEM}\" in\nLinux|GNU|GNU/*)\n\t# If the system lacks a compiler, then just pick glibc.\n\t# We could probably try harder.\n\tLIBC=gnu\n\n\teval $set_cc_for_build\n\tcat <<-EOF > $dummy.c\n\t#include <features.h>\n\t#if defined(__UCLIBC__)\n\tLIBC=uclibc\n\t#elif defined(__dietlibc__)\n\tLIBC=dietlibc\n\t#else\n\tLIBC=gnu\n\t#endif\n\tEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`\n\t;;\nesac\n\n# Note: order is significant - the case branches are not exclusive.\n\ncase \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" in\n    *:NetBSD:*:*)\n\t# NetBSD (nbsd) targets should (where applicable) match one or\n\t# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,\n\t# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently\n\t# switched to ELF, *-*-netbsd* would select the old\n\t# object file format.  This provides both forward\n\t# compatibility and a consistent mechanism for selecting the\n\t# object file format.\n\t#\n\t# Note: NetBSD doesn't particularly care about the vendor\n\t# portion of the name.  We always set it to \"unknown\".\n\tsysctl=\"sysctl -n hw.machine_arch\"\n\tUNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \\\n\t    /sbin/$sysctl 2>/dev/null || \\\n\t    /usr/sbin/$sysctl 2>/dev/null || \\\n\t    echo unknown)`\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    armeb) machine=armeb-unknown ;;\n\t    arm*) machine=arm-unknown ;;\n\t    sh3el) machine=shl-unknown ;;\n\t    sh3eb) machine=sh-unknown ;;\n\t    sh5el) machine=sh5le-unknown ;;\n\t    earmv*)\n\t\tarch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\\(armv[0-9]\\).*$,\\1,'`\n\t\tendian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\\(eb\\)$,\\1,p'`\n\t\tmachine=${arch}${endian}-unknown\n\t\t;;\n\t    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;\n\tesac\n\t# The Operating System including object format, if it has switched\n\t# to ELF recently (or will in the future) and ABI.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\tos=netbsdelf\n\t\t;;\n\t    arm*|i386|m68k|ns32k|sh3*|sparc|vax)\n\t\teval $set_cc_for_build\n\t\tif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t\t| grep -q __ELF__\n\t\tthen\n\t\t    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).\n\t\t    # Return netbsd for either.  FIX?\n\t\t    os=netbsd\n\t\telse\n\t\t    os=netbsdelf\n\t\tfi\n\t\t;;\n\t    *)\n\t\tos=netbsd\n\t\t;;\n\tesac\n\t# Determine ABI tags.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\texpr='s/^earmv[0-9]/-eabi/;s/eb$//'\n\t\tabi=`echo ${UNAME_MACHINE_ARCH} | sed -e \"$expr\"`\n\t\t;;\n\tesac\n\t# The OS release\n\t# Debian GNU/NetBSD machines have a different userland, and\n\t# thus, need a distinct triplet. However, they do not need\n\t# kernel version information, so it can be replaced with a\n\t# suitable tag, in the style of linux-gnu.\n\tcase \"${UNAME_VERSION}\" in\n\t    Debian*)\n\t\trelease='-gnu'\n\t\t;;\n\t    *)\n\t\trelease=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`\n\t\t;;\n\tesac\n\t# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:\n\t# contains redundant information, the shorter form:\n\t# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.\n\techo \"${machine}-${os}${release}${abi}\"\n\texit ;;\n    *:Bitrig:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}\n\texit ;;\n    *:OpenBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}\n\texit ;;\n    *:LibertyBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\\.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}\n\texit ;;\n    *:MidnightBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-midnightbsd${UNAME_RELEASE}\n\texit ;;\n    *:ekkoBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}\n\texit ;;\n    *:SolidBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}\n\texit ;;\n    macppc:MirBSD:*:*)\n\techo powerpc-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:MirBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:Sortix:*:*)\n\techo ${UNAME_MACHINE}-unknown-sortix\n\texit ;;\n    *:Redox:*:*)\n\techo ${UNAME_MACHINE}-unknown-redox\n\texit ;;\n    alpha:OSF1:*:*)\n\tcase $UNAME_RELEASE in\n\t*4.0)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`\n\t\t;;\n\t*5.*)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n\t\t;;\n\tesac\n\t# According to Compaq, /usr/sbin/psrinfo has been available on\n\t# OSF/1 and Tru64 systems produced since 1995.  I hope that\n\t# covers most systems running today.  This code pipes the CPU\n\t# types through head -n 1, so we only detect the type of CPU 0.\n\tALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \\(.*\\) processor.*$/\\1/p' | head -n 1`\n\tcase \"$ALPHA_CPU_TYPE\" in\n\t    \"EV4 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV4.5 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"LCA4 (21066/21068)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV5 (21164)\")\n\t\tUNAME_MACHINE=alphaev5 ;;\n\t    \"EV5.6 (21164A)\")\n\t\tUNAME_MACHINE=alphaev56 ;;\n\t    \"EV5.6 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca56 ;;\n\t    \"EV5.7 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca57 ;;\n\t    \"EV6 (21264)\")\n\t\tUNAME_MACHINE=alphaev6 ;;\n\t    \"EV6.7 (21264A)\")\n\t\tUNAME_MACHINE=alphaev67 ;;\n\t    \"EV6.8CB (21264C)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8AL (21264B)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8CX (21264D)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.9A (21264/EV69A)\")\n\t\tUNAME_MACHINE=alphaev69 ;;\n\t    \"EV7 (21364)\")\n\t\tUNAME_MACHINE=alphaev7 ;;\n\t    \"EV7.9 (21364A)\")\n\t\tUNAME_MACHINE=alphaev79 ;;\n\tesac\n\t# A Pn.n version is a patched version.\n\t# A Vn.n version is a released version.\n\t# A Tn.n version is a released field test version.\n\t# A Xn.n version is an unreleased experimental baselevel.\n\t# 1.2 uses \"1.2\" for uname -r.\n\techo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\t# Reset EXIT trap before exiting to avoid spurious non-zero exit code.\n\texitcode=$?\n\ttrap '' 0\n\texit $exitcode ;;\n    Amiga*:UNIX_System_V:4.0:*)\n\techo m68k-unknown-sysv4\n\texit ;;\n    *:[Aa]miga[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-amigaos\n\texit ;;\n    *:[Mm]orph[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-morphos\n\texit ;;\n    *:OS/390:*:*)\n\techo i370-ibm-openedition\n\texit ;;\n    *:z/VM:*:*)\n\techo s390-ibm-zvmoe\n\texit ;;\n    *:OS400:*:*)\n\techo powerpc-ibm-os400\n\texit ;;\n    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)\n\techo arm-acorn-riscix${UNAME_RELEASE}\n\texit ;;\n    arm*:riscos:*:*|arm*:RISCOS:*:*)\n\techo arm-unknown-riscos\n\texit ;;\n    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)\n\techo hppa1.1-hitachi-hiuxmpp\n\texit ;;\n    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)\n\t# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.\n\tif test \"`(/bin/universe) 2>/dev/null`\" = att ; then\n\t\techo pyramid-pyramid-sysv3\n\telse\n\t\techo pyramid-pyramid-bsd\n\tfi\n\texit ;;\n    NILE*:*:*:dcosx)\n\techo pyramid-pyramid-svr4\n\texit ;;\n    DRS?6000:unix:4.0:6*)\n\techo sparc-icl-nx6\n\texit ;;\n    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)\n\tcase `/usr/bin/uname -p` in\n\t    sparc) echo sparc-icl-nx7; exit ;;\n\tesac ;;\n    s390x:SunOS:*:*)\n\techo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4H:SunOS:5.*:*)\n\techo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)\n\techo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)\n\techo i386-pc-auroraux${UNAME_RELEASE}\n\texit ;;\n    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)\n\teval $set_cc_for_build\n\tSUN_ARCH=i386\n\t# If there is a compiler, see if it is configured for 64-bit objects.\n\t# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.\n\t# This test works for both compilers.\n\tif [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t(CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\tgrep IS_64BIT_ARCH >/dev/null\n\t    then\n\t\tSUN_ARCH=x86_64\n\t    fi\n\tfi\n\techo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:6*:*)\n\t# According to config.sub, this is the proper way to canonicalize\n\t# SunOS6.  Hard to guess exactly what SunOS6 will be like, but\n\t# it's likely to be more like Solaris than SunOS4.\n\techo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:*:*)\n\tcase \"`/usr/bin/arch -k`\" in\n\t    Series*|S4*)\n\t\tUNAME_RELEASE=`uname -v`\n\t\t;;\n\tesac\n\t# Japanese Language versions have a version number like `4.1.3-JL'.\n\techo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`\n\texit ;;\n    sun3*:SunOS:*:*)\n\techo m68k-sun-sunos${UNAME_RELEASE}\n\texit ;;\n    sun*:*:4.2BSD:*)\n\tUNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`\n\ttest \"x${UNAME_RELEASE}\" = x && UNAME_RELEASE=3\n\tcase \"`/bin/arch`\" in\n\t    sun3)\n\t\techo m68k-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\t    sun4)\n\t\techo sparc-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\tesac\n\texit ;;\n    aushp:SunOS:*:*)\n\techo sparc-auspex-sunos${UNAME_RELEASE}\n\texit ;;\n    # The situation for MiNT is a little confusing.  The machine name\n    # can be virtually everything (everything which is not\n    # \"atarist\" or \"atariste\" at least should have a processor\n    # > m68000).  The system name ranges from \"MiNT\" over \"FreeMiNT\"\n    # to the lowercase version \"mint\" (or \"freemint\").  Finally\n    # the system name \"TOS\" denotes a system which is actually not\n    # MiNT.  But MiNT is downward compatible to TOS, so this should\n    # be no problem.\n    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)\n\techo m68k-milan-mint${UNAME_RELEASE}\n\texit ;;\n    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)\n\techo m68k-hades-mint${UNAME_RELEASE}\n\texit ;;\n    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)\n\techo m68k-unknown-mint${UNAME_RELEASE}\n\texit ;;\n    m68k:machten:*:*)\n\techo m68k-apple-machten${UNAME_RELEASE}\n\texit ;;\n    powerpc:machten:*:*)\n\techo powerpc-apple-machten${UNAME_RELEASE}\n\texit ;;\n    RISC*:Mach:*:*)\n\techo mips-dec-mach_bsd4.3\n\texit ;;\n    RISC*:ULTRIX:*:*)\n\techo mips-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    VAX*:ULTRIX*:*:*)\n\techo vax-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    2020:CLIX:*:* | 2430:CLIX:*:*)\n\techo clipper-intergraph-clix${UNAME_RELEASE}\n\texit ;;\n    mips:*:*:UMIPS | mips:*:*:RISCos)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n#ifdef __cplusplus\n#include <stdio.h>  /* for printf() prototype */\n\tint main (int argc, char *argv[]) {\n#else\n\tint main (argc, argv) int argc; char *argv[]; {\n#endif\n\t#if defined (host_mips) && defined (MIPSEB)\n\t#if defined (SYSTYPE_SYSV)\n\t  printf (\"mips-mips-riscos%ssysv\\\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_SVR4)\n\t  printf (\"mips-mips-riscos%ssvr4\\\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)\n\t  printf (\"mips-mips-riscos%sbsd\\\\n\", argv[1]); exit (0);\n\t#endif\n\t#endif\n\t  exit (-1);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c &&\n\t  dummyarg=`echo \"${UNAME_RELEASE}\" | sed -n 's/\\([0-9]*\\).*/\\1/p'` &&\n\t  SYSTEM_NAME=`$dummy $dummyarg` &&\n\t    { echo \"$SYSTEM_NAME\"; exit; }\n\techo mips-mips-riscos${UNAME_RELEASE}\n\texit ;;\n    Motorola:PowerMAX_OS:*:*)\n\techo powerpc-motorola-powermax\n\texit ;;\n    Motorola:*:4.3:PL8-*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:Power_UNIX:*:*)\n\techo powerpc-harris-powerunix\n\texit ;;\n    m88k:CX/UX:7*:*)\n\techo m88k-harris-cxux7\n\texit ;;\n    m88k:*:4*:R4*)\n\techo m88k-motorola-sysv4\n\texit ;;\n    m88k:*:3*:R3*)\n\techo m88k-motorola-sysv3\n\texit ;;\n    AViiON:dgux:*:*)\n\t# DG/UX returns AViiON for all architectures\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tif [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]\n\tthen\n\t    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \\\n\t       [ ${TARGET_BINARY_INTERFACE}x = x ]\n\t    then\n\t\techo m88k-dg-dgux${UNAME_RELEASE}\n\t    else\n\t\techo m88k-dg-dguxbcs${UNAME_RELEASE}\n\t    fi\n\telse\n\t    echo i586-dg-dgux${UNAME_RELEASE}\n\tfi\n\texit ;;\n    M88*:DolphinOS:*:*)\t# DolphinOS (SVR3)\n\techo m88k-dolphin-sysv3\n\texit ;;\n    M88*:*:R3*:*)\n\t# Delta 88k system running SVR3\n\techo m88k-motorola-sysv3\n\texit ;;\n    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)\n\techo m88k-tektronix-sysv3\n\texit ;;\n    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)\n\techo m68k-tektronix-bsd\n\texit ;;\n    *:IRIX*:*:*)\n\techo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`\n\texit ;;\n    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.\n\techo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id\n\texit ;;               # Note that: echo \"'`uname -s`'\" gives 'AIX '\n    i*86:AIX:*:*)\n\techo i386-ibm-aix\n\texit ;;\n    ia64:AIX:*:*)\n\tif [ -x /usr/bin/oslevel ] ; then\n\t\tIBM_REV=`/usr/bin/oslevel`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${UNAME_MACHINE}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:2:3)\n\tif grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\teval $set_cc_for_build\n\t\tsed 's/^\t\t//' << EOF >$dummy.c\n\t\t#include <sys/systemcfg.h>\n\n\t\tmain()\n\t\t\t{\n\t\t\tif (!__power_pc())\n\t\t\t\texit(1);\n\t\t\tputs(\"powerpc-ibm-aix3.2.5\");\n\t\t\texit(0);\n\t\t\t}\nEOF\n\t\tif $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`\n\t\tthen\n\t\t\techo \"$SYSTEM_NAME\"\n\t\telse\n\t\t\techo rs6000-ibm-aix3.2.5\n\t\tfi\n\telif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\techo rs6000-ibm-aix3.2.4\n\telse\n\t\techo rs6000-ibm-aix3.2\n\tfi\n\texit ;;\n    *:AIX:*:[4567])\n\tIBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`\n\tif /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then\n\t\tIBM_ARCH=rs6000\n\telse\n\t\tIBM_ARCH=powerpc\n\tfi\n\tif [ -x /usr/bin/lslpp ] ; then\n\t\tIBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |\n\t\t\t   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${IBM_ARCH}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:*:*)\n\techo rs6000-ibm-aix\n\texit ;;\n    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)\n\techo romp-ibm-bsd4.4\n\texit ;;\n    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and\n\techo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to\n\texit ;;                             # report: romp-ibm BSD 4.3\n    *:BOSX:*:*)\n\techo rs6000-bull-bosx\n\texit ;;\n    DPX/2?00:B.O.S.:*:*)\n\techo m68k-bull-sysv3\n\texit ;;\n    9000/[34]??:4.3bsd:1.*:*)\n\techo m68k-hp-bsd\n\texit ;;\n    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)\n\techo m68k-hp-bsd4.4\n\texit ;;\n    9000/[34678]??:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\tcase \"${UNAME_MACHINE}\" in\n\t    9000/31?)            HP_ARCH=m68000 ;;\n\t    9000/[34]??)         HP_ARCH=m68k ;;\n\t    9000/[678][0-9][0-9])\n\t\tif [ -x /usr/bin/getconf ]; then\n\t\t    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`\n\t\t    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n\t\t    case \"${sc_cpu_version}\" in\n\t\t      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0\n\t\t      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1\n\t\t      532)                      # CPU_PA_RISC2_0\n\t\t\tcase \"${sc_kernel_bits}\" in\n\t\t\t  32) HP_ARCH=hppa2.0n ;;\n\t\t\t  64) HP_ARCH=hppa2.0w ;;\n\t\t\t  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20\n\t\t\tesac ;;\n\t\t    esac\n\t\tfi\n\t\tif [ \"${HP_ARCH}\" = \"\" ]; then\n\t\t    eval $set_cc_for_build\n\t\t    sed 's/^\t\t//' << EOF >$dummy.c\n\n\t\t#define _HPUX_SOURCE\n\t\t#include <stdlib.h>\n\t\t#include <unistd.h>\n\n\t\tint main ()\n\t\t{\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t    long bits = sysconf(_SC_KERNEL_BITS);\n\t\t#endif\n\t\t    long cpu  = sysconf (_SC_CPU_VERSION);\n\n\t\t    switch (cpu)\n\t\t\t{\n\t\t\tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n\t\t\tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n\t\t\tcase CPU_PA_RISC2_0:\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t\t    switch (bits)\n\t\t\t\t{\n\t\t\t\tcase 64: puts (\"hppa2.0w\"); break;\n\t\t\t\tcase 32: puts (\"hppa2.0n\"); break;\n\t\t\t\tdefault: puts (\"hppa2.0\"); break;\n\t\t\t\t} break;\n\t\t#else  /* !defined(_SC_KERNEL_BITS) */\n\t\t\t    puts (\"hppa2.0\"); break;\n\t\t#endif\n\t\t\tdefault: puts (\"hppa1.0\"); break;\n\t\t\t}\n\t\t    exit (0);\n\t\t}\nEOF\n\t\t    (CCOPTS=\"\" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`\n\t\t    test -z \"$HP_ARCH\" && HP_ARCH=hppa\n\t\tfi ;;\n\tesac\n\tif [ ${HP_ARCH} = hppa2.0w ]\n\tthen\n\t    eval $set_cc_for_build\n\n\t    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating\n\t    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler\n\t    # generating 64-bit code.  GNU and HP use different nomenclature:\n\t    #\n\t    # $ CC_FOR_BUILD=cc ./config.guess\n\t    # => hppa2.0w-hp-hpux11.23\n\t    # $ CC_FOR_BUILD=\"cc +DA2.0w\" ./config.guess\n\t    # => hppa64-hp-hpux11.23\n\n\t    if echo __LP64__ | (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) |\n\t\tgrep -q __LP64__\n\t    then\n\t\tHP_ARCH=hppa2.0w\n\t    else\n\t\tHP_ARCH=hppa64\n\t    fi\n\tfi\n\techo ${HP_ARCH}-hp-hpux${HPUX_REV}\n\texit ;;\n    ia64:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\techo ia64-hp-hpux${HPUX_REV}\n\texit ;;\n    3050*:HI-UX:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#include <unistd.h>\n\tint\n\tmain ()\n\t{\n\t  long cpu = sysconf (_SC_CPU_VERSION);\n\t  /* The order matters, because CPU_IS_HP_MC68K erroneously returns\n\t     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct\n\t     results, however.  */\n\t  if (CPU_IS_PA_RISC (cpu))\n\t    {\n\t      switch (cpu)\n\t\t{\n\t\t  case CPU_PA_RISC1_0: puts (\"hppa1.0-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC1_1: puts (\"hppa1.1-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC2_0: puts (\"hppa2.0-hitachi-hiuxwe2\"); break;\n\t\t  default: puts (\"hppa-hitachi-hiuxwe2\"); break;\n\t\t}\n\t    }\n\t  else if (CPU_IS_HP_MC68K (cpu))\n\t    puts (\"m68k-hitachi-hiuxwe2\");\n\t  else puts (\"unknown-hitachi-hiuxwe2\");\n\t  exit (0);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&\n\t\t{ echo \"$SYSTEM_NAME\"; exit; }\n\techo unknown-hitachi-hiuxwe2\n\texit ;;\n    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)\n\techo hppa1.1-hp-bsd\n\texit ;;\n    9000/8??:4.3bsd:*:*)\n\techo hppa1.0-hp-bsd\n\texit ;;\n    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)\n\techo hppa1.0-hp-mpeix\n\texit ;;\n    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)\n\techo hppa1.1-hp-osf\n\texit ;;\n    hp8??:OSF1:*:*)\n\techo hppa1.0-hp-osf\n\texit ;;\n    i*86:OSF1:*:*)\n\tif [ -x /usr/sbin/sysversion ] ; then\n\t    echo ${UNAME_MACHINE}-unknown-osf1mk\n\telse\n\t    echo ${UNAME_MACHINE}-unknown-osf1\n\tfi\n\texit ;;\n    parisc*:Lites*:*:*)\n\techo hppa1.1-hp-lites\n\texit ;;\n    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)\n\techo c1-convex-bsd\n\texit ;;\n    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)\n\tif getsysinfo -f scalar_acc\n\tthen echo c32-convex-bsd\n\telse echo c2-convex-bsd\n\tfi\n\texit ;;\n    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)\n\techo c34-convex-bsd\n\texit ;;\n    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)\n\techo c38-convex-bsd\n\texit ;;\n    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)\n\techo c4-convex-bsd\n\texit ;;\n    CRAY*Y-MP:*:*:*)\n\techo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*[A-Z]90:*:*:*)\n\techo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \\\n\t| sed -e 's/CRAY.*\\([A-Z]90\\)/\\1/' \\\n\t      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \\\n\t      -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*TS:*:*:*)\n\techo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*T3E:*:*:*)\n\techo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*SV1:*:*:*)\n\techo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    *:UNICOS/mp:*:*)\n\techo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)\n\tFUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n\techo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    5000:UNIX_System_V:4.*:*)\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`\n\techo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\\ Embedded/OS:*:*)\n\techo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}\n\texit ;;\n    sparc*:BSD/OS:*:*)\n\techo sparc-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:BSD/OS:*:*)\n\techo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:FreeBSD:*:*)\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tcase ${UNAME_PROCESSOR} in\n\t    amd64)\n\t\tUNAME_PROCESSOR=x86_64 ;;\n\t    i386)\n\t\tUNAME_PROCESSOR=i586 ;;\n\tesac\n\techo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit ;;\n    i*:CYGWIN*:*)\n\techo ${UNAME_MACHINE}-pc-cygwin\n\texit ;;\n    *:MINGW64*:*)\n\techo ${UNAME_MACHINE}-pc-mingw64\n\texit ;;\n    *:MINGW*:*)\n\techo ${UNAME_MACHINE}-pc-mingw32\n\texit ;;\n    *:MSYS*:*)\n\techo ${UNAME_MACHINE}-pc-msys\n\texit ;;\n    i*:PW*:*)\n\techo ${UNAME_MACHINE}-pc-pw32\n\texit ;;\n    *:Interix*:*)\n\tcase ${UNAME_MACHINE} in\n\t    x86)\n\t\techo i586-pc-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    authenticamd | genuineintel | EM64T)\n\t\techo x86_64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    IA64)\n\t\techo ia64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\tesac ;;\n    i*:UWIN*:*)\n\techo ${UNAME_MACHINE}-pc-uwin\n\texit ;;\n    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)\n\techo x86_64-unknown-cygwin\n\texit ;;\n    prep*:SunOS:5.*:*)\n\techo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    *:GNU:*:*)\n\t# the GNU system\n\techo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`\n\texit ;;\n    *:GNU/*:*:*)\n\t# other systems with GNU libc and userland\n\techo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr \"[:upper:]\" \"[:lower:]\"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}\n\texit ;;\n    i*86:Minix:*:*)\n\techo ${UNAME_MACHINE}-pc-minix\n\texit ;;\n    aarch64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    aarch64_be:Linux:*:*)\n\tUNAME_MACHINE=aarch64_be\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    alpha:Linux:*:*)\n\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n\tesac\n\tobjdump --private-headers /bin/sh | grep -q ld.so.1\n\tif test \"$?\" = 0 ; then LIBC=gnulibc1 ; fi\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arc:Linux:*:* | arceb:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arm*:Linux:*:*)\n\teval $set_cc_for_build\n\tif echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t    | grep -q __ARM_EABI__\n\tthen\n\t    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\telse\n\t    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t| grep -q __ARM_PCS_VFP\n\t    then\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi\n\t    else\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf\n\t    fi\n\tfi\n\texit ;;\n    avr32*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    cris:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    crisv32:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    e2k:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    frv:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    hexagon:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    ia64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    k1om:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m32r*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m68*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    mips:Linux:*:* | mips64:Linux:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#undef CPU\n\t#undef ${UNAME_MACHINE}\n\t#undef ${UNAME_MACHINE}el\n\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n\tCPU=${UNAME_MACHINE}el\n\t#else\n\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n\tCPU=${UNAME_MACHINE}\n\t#else\n\tCPU=\n\t#endif\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`\n\ttest x\"${CPU}\" != x && { echo \"${CPU}-unknown-linux-${LIBC}\"; exit; }\n\t;;\n    mips64el:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    openrisc*:Linux:*:*)\n\techo or1k-unknown-linux-${LIBC}\n\texit ;;\n    or32:Linux:*:* | or1k*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    padre:Linux:*:*)\n\techo sparc-unknown-linux-${LIBC}\n\texit ;;\n    parisc64:Linux:*:* | hppa64:Linux:*:*)\n\techo hppa64-unknown-linux-${LIBC}\n\texit ;;\n    parisc:Linux:*:* | hppa:Linux:*:*)\n\t# Look for CPU level\n\tcase `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in\n\t  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;\n\t  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;\n\t  *)    echo hppa-unknown-linux-${LIBC} ;;\n\tesac\n\texit ;;\n    ppc64:Linux:*:*)\n\techo powerpc64-unknown-linux-${LIBC}\n\texit ;;\n    ppc:Linux:*:*)\n\techo powerpc-unknown-linux-${LIBC}\n\texit ;;\n    ppc64le:Linux:*:*)\n\techo powerpc64le-unknown-linux-${LIBC}\n\texit ;;\n    ppcle:Linux:*:*)\n\techo powerpcle-unknown-linux-${LIBC}\n\texit ;;\n    riscv32:Linux:*:* | riscv64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    s390:Linux:*:* | s390x:Linux:*:*)\n\techo ${UNAME_MACHINE}-ibm-linux-${LIBC}\n\texit ;;\n    sh64*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sh*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sparc:Linux:*:* | sparc64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    tile*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    vax:Linux:*:*)\n\techo ${UNAME_MACHINE}-dec-linux-${LIBC}\n\texit ;;\n    x86_64:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    xtensa*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:DYNIX/ptx:4*:*)\n\t# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.\n\t# earlier versions are messed up and put the nodename in both\n\t# sysname and nodename.\n\techo i386-sequent-sysv4\n\texit ;;\n    i*86:UNIX_SV:4.2MP:2.*)\n\t# Unixware is an offshoot of SVR4, but it has its own version\n\t# number series starting with 2...\n\t# I am not positive that other SVR4 systems won't match this,\n\t# I just have to hope.  -- rms.\n\t# Use sysv4.2uw... so that sysv4* matches it.\n\techo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}\n\texit ;;\n    i*86:OS/2:*:*)\n\t# If we were able to find `uname', then EMX Unix compatibility\n\t# is probably installed.\n\techo ${UNAME_MACHINE}-pc-os2-emx\n\texit ;;\n    i*86:XTS-300:*:STOP)\n\techo ${UNAME_MACHINE}-unknown-stop\n\texit ;;\n    i*86:atheos:*:*)\n\techo ${UNAME_MACHINE}-unknown-atheos\n\texit ;;\n    i*86:syllable:*:*)\n\techo ${UNAME_MACHINE}-pc-syllable\n\texit ;;\n    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)\n\techo i386-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    i*86:*DOS:*:*)\n\techo ${UNAME_MACHINE}-pc-msdosdjgpp\n\texit ;;\n    i*86:*:4.*:*)\n\tUNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\\/MP$//'`\n\tif grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then\n\t\techo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}\n\tfi\n\texit ;;\n    i*86:*:5:[678]*)\n\t# UnixWare 7.x, OpenUNIX and OpenServer 6.\n\tcase `/bin/uname -X | grep \"^Machine\"` in\n\t    *486*)\t     UNAME_MACHINE=i486 ;;\n\t    *Pentium)\t     UNAME_MACHINE=i586 ;;\n\t    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;\n\tesac\n\techo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}\n\texit ;;\n    i*86:*:3.2:*)\n\tif test -f /usr/options/cb.name; then\n\t\tUNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`\n\t\techo ${UNAME_MACHINE}-pc-isc$UNAME_REL\n\telif /bin/uname -X 2>/dev/null >/dev/null ; then\n\t\tUNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`\n\t\t(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486\n\t\t(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i586\n\t\t(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\t(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\techo ${UNAME_MACHINE}-pc-sco$UNAME_REL\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv32\n\tfi\n\texit ;;\n    pc:*:*:*)\n\t# Left here for compatibility:\n\t# uname -m prints for DJGPP always 'pc', but it prints nothing about\n\t# the processor, so we play safe by assuming i586.\n\t# Note: whatever this is, it MUST be the same as what config.sub\n\t# prints for the \"djgpp\" host, or else GDB configure will decide that\n\t# this is a cross-build.\n\techo i586-pc-msdosdjgpp\n\texit ;;\n    Intel:Mach:3*:*)\n\techo i386-pc-mach3\n\texit ;;\n    paragon:*:*:*)\n\techo i860-intel-osf1\n\texit ;;\n    i860:*:4.*:*) # i860-SVR4\n\tif grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then\n\t  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4\n\telse # Add other i860-SVR4 vendors below as they are discovered.\n\t  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4\n\tfi\n\texit ;;\n    mini*:CTIX:SYS*5:*)\n\t# \"miniframe\"\n\techo m68010-convergent-sysv\n\texit ;;\n    mc68k:UNIX:SYSTEM5:3.51m)\n\techo m68k-convergent-sysv\n\texit ;;\n    M680?0:D-NIX:5.3:*)\n\techo m68k-diab-dnix\n\texit ;;\n    M68*:*:R3V[5678]*:*)\n\ttest -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;\n    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)\n\tOS_REL=''\n\ttest -r /etc/.relid \\\n\t&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4; exit; } ;;\n    NCR*:*:4.2:* | MPRAS*:*:4.2:*)\n\tOS_REL='.3'\n\ttest -r /etc/.relid \\\n\t    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)\n\techo m68k-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    mc68030:UNIX_System_V:4.*:*)\n\techo m68k-atari-sysv4\n\texit ;;\n    TSUNAMI:LynxOS:2.*:*)\n\techo sparc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    rs6000:LynxOS:2.*:*)\n\techo rs6000-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)\n\techo powerpc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    SM[BE]S:UNIX_SV:*:*)\n\techo mips-dde-sysv${UNAME_RELEASE}\n\texit ;;\n    RM*:ReliantUNIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    RM*:SINIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    *:SINIX-*:*:*)\n\tif uname -p 2>/dev/null >/dev/null ; then\n\t\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\t\techo ${UNAME_MACHINE}-sni-sysv4\n\telse\n\t\techo ns32k-sni-sysv\n\tfi\n\texit ;;\n    PENTIUM:*:4.0*:*)\t# Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n\t\t\t# says <Richard.M.Bartel@ccMail.Census.GOV>\n\techo i586-unisys-sysv4\n\texit ;;\n    *:UNIX_System_V:4*:FTX*)\n\t# From Gerald Hewes <hewes@openmarket.com>.\n\t# How about differentiating between stratus architectures? -djm\n\techo hppa1.1-stratus-sysv4\n\texit ;;\n    *:*:*:FTX*)\n\t# From seanf@swdc.stratus.com.\n\techo i860-stratus-sysv4\n\texit ;;\n    i*86:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo ${UNAME_MACHINE}-stratus-vos\n\texit ;;\n    *:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo hppa1.1-stratus-vos\n\texit ;;\n    mc68*:A/UX:*:*)\n\techo m68k-apple-aux${UNAME_RELEASE}\n\texit ;;\n    news*:NEWS-OS:6*:*)\n\techo mips-sony-newsos6\n\texit ;;\n    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)\n\tif [ -d /usr/nec ]; then\n\t\techo mips-nec-sysv${UNAME_RELEASE}\n\telse\n\t\techo mips-unknown-sysv${UNAME_RELEASE}\n\tfi\n\texit ;;\n    BeBox:BeOS:*:*)\t# BeOS running on hardware made by Be, PPC only.\n\techo powerpc-be-beos\n\texit ;;\n    BeMac:BeOS:*:*)\t# BeOS running on Mac or Mac clone, PPC only.\n\techo powerpc-apple-beos\n\texit ;;\n    BePC:BeOS:*:*)\t# BeOS running on Intel PC compatible.\n\techo i586-pc-beos\n\texit ;;\n    BePC:Haiku:*:*)\t# Haiku running on Intel PC compatible.\n\techo i586-pc-haiku\n\texit ;;\n    x86_64:Haiku:*:*)\n\techo x86_64-unknown-haiku\n\texit ;;\n    SX-4:SUPER-UX:*:*)\n\techo sx4-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-5:SUPER-UX:*:*)\n\techo sx5-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-6:SUPER-UX:*:*)\n\techo sx6-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-7:SUPER-UX:*:*)\n\techo sx7-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8:SUPER-UX:*:*)\n\techo sx8-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8R:SUPER-UX:*:*)\n\techo sx8r-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-ACE:SUPER-UX:*:*)\n\techo sxace-nec-superux${UNAME_RELEASE}\n\texit ;;\n    Power*:Rhapsody:*:*)\n\techo powerpc-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Rhapsody:*:*)\n\techo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Darwin:*:*)\n\tUNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown\n\teval $set_cc_for_build\n\tif test \"$UNAME_PROCESSOR\" = unknown ; then\n\t    UNAME_PROCESSOR=powerpc\n\tfi\n\tif test `echo \"$UNAME_RELEASE\" | sed -e 's/\\..*//'` -le 10 ; then\n\t    if [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t\tif (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t       (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\t       grep IS_64BIT_ARCH >/dev/null\n\t\tthen\n\t\t    case $UNAME_PROCESSOR in\n\t\t\ti386) UNAME_PROCESSOR=x86_64 ;;\n\t\t\tpowerpc) UNAME_PROCESSOR=powerpc64 ;;\n\t\t    esac\n\t\tfi\n\t\t# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc\n\t\tif (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \\\n\t\t       (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\t       grep IS_PPC >/dev/null\n\t\tthen\n\t\t    UNAME_PROCESSOR=powerpc\n\t\tfi\n\t    fi\n\telif test \"$UNAME_PROCESSOR\" = i386 ; then\n\t    # Avoid executing cc on OS X 10.9, as it ships with a stub\n\t    # that puts up a graphical alert prompting to install\n\t    # developer tools.  Any system running Mac OS X 10.7 or\n\t    # later (Darwin 11 and later) is required to have a 64-bit\n\t    # processor. This is not true of the ARM version of Darwin\n\t    # that Apple uses in portable devices.\n\t    UNAME_PROCESSOR=x86_64\n\tfi\n\techo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}\n\texit ;;\n    *:procnto*:*:* | *:QNX:[0123456789]*:*)\n\tUNAME_PROCESSOR=`uname -p`\n\tif test \"$UNAME_PROCESSOR\" = x86; then\n\t\tUNAME_PROCESSOR=i386\n\t\tUNAME_MACHINE=pc\n\tfi\n\techo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}\n\texit ;;\n    *:QNX:*:4*)\n\techo i386-pc-qnx\n\texit ;;\n    NEO-*:NONSTOP_KERNEL:*:*)\n\techo neo-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSE-*:NONSTOP_KERNEL:*:*)\n\techo nse-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSR-*:NONSTOP_KERNEL:*:*)\n\techo nsr-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSX-*:NONSTOP_KERNEL:*:*)\n\techo nsx-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    *:NonStop-UX:*:*)\n\techo mips-compaq-nonstopux\n\texit ;;\n    BS2000:POSIX*:*:*)\n\techo bs2000-siemens-sysv\n\texit ;;\n    DS/*:UNIX_System_V:*:*)\n\techo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}\n\texit ;;\n    *:Plan9:*:*)\n\t# \"uname -m\" is not consistent, so use $cputype instead. 386\n\t# is converted to i386 for consistency with other x86\n\t# operating systems.\n\tif test \"$cputype\" = 386; then\n\t    UNAME_MACHINE=i386\n\telse\n\t    UNAME_MACHINE=\"$cputype\"\n\tfi\n\techo ${UNAME_MACHINE}-unknown-plan9\n\texit ;;\n    *:TOPS-10:*:*)\n\techo pdp10-unknown-tops10\n\texit ;;\n    *:TENEX:*:*)\n\techo pdp10-unknown-tenex\n\texit ;;\n    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)\n\techo pdp10-dec-tops20\n\texit ;;\n    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)\n\techo pdp10-xkl-tops20\n\texit ;;\n    *:TOPS-20:*:*)\n\techo pdp10-unknown-tops20\n\texit ;;\n    *:ITS:*:*)\n\techo pdp10-unknown-its\n\texit ;;\n    SEI:*:*:SEIUX)\n\techo mips-sei-seiux${UNAME_RELEASE}\n\texit ;;\n    *:DragonFly:*:*)\n\techo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit ;;\n    *:*VMS:*:*)\n\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\tcase \"${UNAME_MACHINE}\" in\n\t    A*) echo alpha-dec-vms ; exit ;;\n\t    I*) echo ia64-dec-vms ; exit ;;\n\t    V*) echo vax-dec-vms ; exit ;;\n\tesac ;;\n    *:XENIX:*:SysV)\n\techo i386-pc-xenix\n\texit ;;\n    i*86:skyos:*:*)\n\techo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`\n\texit ;;\n    i*86:rdos:*:*)\n\techo ${UNAME_MACHINE}-pc-rdos\n\texit ;;\n    i*86:AROS:*:*)\n\techo ${UNAME_MACHINE}-pc-aros\n\texit ;;\n    x86_64:VMkernel:*:*)\n\techo ${UNAME_MACHINE}-unknown-esx\n\texit ;;\n    amd64:Isilon\\ OneFS:*:*)\n\techo x86_64-unknown-onefs\n\texit ;;\nesac\n\necho \"$0: unable to guess system type\" >&2\n\ncase \"${UNAME_MACHINE}:${UNAME_SYSTEM}\" in\n    mips:Linux | mips64:Linux)\n\t# If we got here on MIPS GNU/Linux, output extra information.\n\tcat >&2 <<EOF\n\nNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize\nthe system type. Please install a C compiler and try again.\nEOF\n\t;;\nesac\n\ncat >&2 <<EOF\n\nThis script (version $timestamp), has failed to recognize the\noperating system you are using. If your script is old, overwrite *all*\ncopies of config.guess and config.sub with the latest versions from:\n\n  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\nand\n  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\nIf $0 has already been updated, send the following data and any\ninformation you think might be pertinent to config-patches@gnu.org to\nprovide the necessary information to handle your system.\n\nconfig.guess timestamp = $timestamp\n\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`\n\nhostinfo               = `(hostinfo) 2>/dev/null`\n/bin/universe          = `(/bin/universe) 2>/dev/null`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`\n/bin/arch              = `(/bin/arch) 2>/dev/null`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n\nUNAME_MACHINE = ${UNAME_MACHINE}\nUNAME_RELEASE = ${UNAME_RELEASE}\nUNAME_SYSTEM  = ${UNAME_SYSTEM}\nUNAME_VERSION = ${UNAME_VERSION}\nEOF\n\nexit 1\n\n# Local variables:\n# eval: (add-hook 'write-file-functions 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "config.h.in",
    "content": "/* config.h.in.  Generated from configure.in by autoheader.  */\n\n/* Define if building universal (internal helper macro) */\n#undef AC_APPLE_UNIVERSAL_BUILD\n\n/* Define to 1 if you have the <fcntl.h> header file. */\n#undef HAVE_FCNTL_H\n\n/* Define to 1 if you have the `gettimeofday' function. */\n#undef HAVE_GETTIMEOFDAY\n\n/* Define to 1 if you have the <inttypes.h> header file. */\n#undef HAVE_INTTYPES_H\n\n/* Define to 1 if you have the `pq' library (-lpq). */\n#undef HAVE_LIBPQ\n\n/* Define to 1 if you have the <memory.h> header file. */\n#undef HAVE_MEMORY_H\n\n/* Define to 1 if you have the <netinet/in.h> header file. */\n#undef HAVE_NETINET_IN_H\n\n/* Define to 1 if you have the `select' function. */\n#undef HAVE_SELECT\n\n/* Define to 1 if you have the `setenv' function. */\n#undef HAVE_SETENV\n\n/* Define to 1 if you have the <stdint.h> header file. */\n#undef HAVE_STDINT_H\n\n/* Define to 1 if you have the <stdlib.h> header file. */\n#undef HAVE_STDLIB_H\n\n/* Define to 1 if you have the `strchr' function. */\n#undef HAVE_STRCHR\n\n/* Define to 1 if you have the <strings.h> header file. */\n#undef HAVE_STRINGS_H\n\n/* Define to 1 if you have the <string.h> header file. */\n#undef HAVE_STRING_H\n\n/* Define to 1 if you have the `strtoul' function. */\n#undef HAVE_STRTOUL\n\n/* Define to 1 if you have the <sys/stat.h> header file. */\n#undef HAVE_SYS_STAT_H\n\n/* Define to 1 if you have the <sys/time.h> header file. */\n#undef HAVE_SYS_TIME_H\n\n/* Define to 1 if you have the <sys/types.h> header file. */\n#undef HAVE_SYS_TYPES_H\n\n/* Define to 1 if you have the <unistd.h> header file. */\n#undef HAVE_UNISTD_H\n\n/* Define to the address where bug reports for this package should be sent. */\n#undef PACKAGE_BUGREPORT\n\n/* Define to the full name of this package. */\n#undef PACKAGE_NAME\n\n/* Define to the full name and version of this package. */\n#undef PACKAGE_STRING\n\n/* Define to the one symbol short name of this package. */\n#undef PACKAGE_TARNAME\n\n/* Define to the home page for this package. */\n#undef PACKAGE_URL\n\n/* Define to the version of this package. */\n#undef PACKAGE_VERSION\n\n/* The size of `unsigned int', as computed by sizeof. */\n#undef SIZEOF_UNSIGNED_INT\n\n/* The size of `unsigned long', as computed by sizeof. */\n#undef SIZEOF_UNSIGNED_LONG\n\n/* The size of `unsigned short', as computed by sizeof. */\n#undef SIZEOF_UNSIGNED_SHORT\n\n/* Define to 1 if you have the ANSI C header files. */\n#undef STDC_HEADERS\n\n/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */\n#undef TIME_WITH_SYS_TIME\n\n/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most\n   significant byte first (like Motorola and SPARC, unlike Intel). */\n#if defined AC_APPLE_UNIVERSAL_BUILD\n# if defined __BIG_ENDIAN__\n#  define WORDS_BIGENDIAN 1\n# endif\n#else\n# ifndef WORDS_BIGENDIAN\n#  undef WORDS_BIGENDIAN\n# endif\n#endif\n\n/* Enable large inode numbers on Mac OS X 10.5.  */\n#ifndef _DARWIN_USE_64_BIT_INODE\n# define _DARWIN_USE_64_BIT_INODE 1\n#endif\n\n/* Number of bits in a file offset, on hosts where this is settable. */\n#undef _FILE_OFFSET_BITS\n\n/* Define for large files, on AIX-style hosts. */\n#undef _LARGE_FILES\n\n/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,\n   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the\n   #define below would cause a syntax error. */\n#undef _UINT32_T\n\n/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,\n   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the\n   #define below would cause a syntax error. */\n#undef _UINT64_T\n\n/* Define to `unsigned int' if <sys/types.h> does not define. */\n#undef size_t\n\n/* Define to `int' if <sys/types.h> does not define. */\n#undef ssize_t\n\n/* Define to the type of an unsigned integer type of width exactly 32 bits if\n   such a type exists and the standard includes do not define it. */\n#undef uint32_t\n\n/* Define to the type of an unsigned integer type of width exactly 64 bits if\n   such a type exists and the standard includes do not define it. */\n#undef uint64_t\n"
  },
  {
    "path": "config.sub",
    "content": "#! /bin/sh\n# Configuration validation subroutine script.\n#   Copyright 1992-2017 Free Software Foundation, Inc.\n\ntimestamp='2017-11-23'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <https://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n\n\n# Please send patches to <config-patches@gnu.org>.\n#\n# Configuration subroutine to validate and canonicalize a configuration type.\n# Supply the specified configuration type as an argument.\n# If it is invalid, we print an error message on stderr and exit with code 1.\n# Otherwise, we print the canonical config type on stdout and succeed.\n\n# You can get the latest version of this script from:\n# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\n# This file is supposed to be the same for all GNU packages\n# and recognize all the CPU types, system types and aliases\n# that are meaningful with *any* GNU software.\n# Each package is responsible for reporting which valid configurations\n# it does not support.  The user should be able to distinguish\n# a failure to support a valid configuration from a meaningless\n# configuration.\n\n# The goal of this file is to map all the various variations of a given\n# machine specification into a single specification in the form:\n#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n# or in some cases, the newer four-part form:\n#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n# It is wrong to echo any other type of specification.\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS\n\nCanonicalize a configuration name.\n\nOptions:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.sub ($timestamp)\n\nCopyright 1992-2017 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\"\n       exit 1 ;;\n\n    *local*)\n       # First pass through any local machine types.\n       echo $1\n       exit ;;\n\n    * )\n       break ;;\n  esac\ndone\n\ncase $# in\n 0) echo \"$me: missing argument$help\" >&2\n    exit 1;;\n 1) ;;\n *) echo \"$me: too many arguments$help\" >&2\n    exit 1;;\nesac\n\n# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).\n# Here we must recognize all the valid KERNEL-OS combinations.\nmaybe_os=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\2/'`\ncase $maybe_os in\n  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \\\n  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \\\n  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \\\n  kopensolaris*-gnu* | cloudabi*-eabi* | \\\n  storm-chaos* | os2-emx* | rtmk-nova*)\n    os=-$maybe_os\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`\n    ;;\n  android-linux)\n    os=-linux-android\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`-unknown\n    ;;\n  *)\n    basic_machine=`echo $1 | sed 's/-[^-]*$//'`\n    if [ $basic_machine != $1 ]\n    then os=`echo $1 | sed 's/.*-/-/'`\n    else os=; fi\n    ;;\nesac\n\n### Let's recognize common machines as not being operating systems so\n### that things like config.sub decstation-3100 work.  We also\n### recognize some manufacturers as not being operating systems, so we\n### can provide default operating systems below.\ncase $os in\n\t-sun*os*)\n\t\t# Prevent following clause from handling this invalid input.\n\t\t;;\n\t-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \\\n\t-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \\\n\t-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \\\n\t-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\\\n\t-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \\\n\t-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \\\n\t-apple | -axis | -knuth | -cray | -microblaze*)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-bluegene*)\n\t\tos=-cnk\n\t\t;;\n\t-sim | -cisco | -oki | -wec | -winbond)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-scout)\n\t\t;;\n\t-wrs)\n\t\tos=-vxworks\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusos*)\n\t\tos=-chorusos\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusrdb)\n\t\tos=-chorusrdb\n\t\tbasic_machine=$1\n\t\t;;\n\t-hiux*)\n\t\tos=-hiuxwe2\n\t\t;;\n\t-sco6)\n\t\tos=-sco5v6\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5)\n\t\tos=-sco3.2v5\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco4)\n\t\tos=-sco3.2v4\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2.[4-9]*)\n\t\tos=`echo $os | sed -e 's/sco3.2./sco3.2v/'`\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2v[4-9]*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5v6*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco*)\n\t\tos=-sco3.2v2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-udk*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-isc)\n\t\tos=-isc2.2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-clix*)\n\t\tbasic_machine=clipper-intergraph\n\t\t;;\n\t-isc*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-lynx*178)\n\t\tos=-lynxos178\n\t\t;;\n\t-lynx*5)\n\t\tos=-lynxos5\n\t\t;;\n\t-lynx*)\n\t\tos=-lynxos\n\t\t;;\n\t-ptx*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`\n\t\t;;\n\t-psos*)\n\t\tos=-psos\n\t\t;;\n\t-mint | -mint[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\nesac\n\n# Decode aliases for certain CPU-COMPANY combinations.\ncase $basic_machine in\n\t# Recognize the basic CPU types without company name.\n\t# Some are omitted here because they have special meanings below.\n\t1750a | 580 \\\n\t| a29k \\\n\t| aarch64 | aarch64_be \\\n\t| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \\\n\t| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \\\n\t| am33_2.0 \\\n\t| arc | arceb \\\n\t| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \\\n\t| avr | avr32 \\\n\t| ba \\\n\t| be32 | be64 \\\n\t| bfin \\\n\t| c4x | c8051 | clipper \\\n\t| d10v | d30v | dlx | dsp16xx \\\n\t| e2k | epiphany \\\n\t| fido | fr30 | frv | ft32 \\\n\t| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \\\n\t| hexagon \\\n\t| i370 | i860 | i960 | ia16 | ia64 \\\n\t| ip2k | iq2000 \\\n\t| k1om \\\n\t| le32 | le64 \\\n\t| lm32 \\\n\t| m32c | m32r | m32rle | m68000 | m68k | m88k \\\n\t| maxq | mb | microblaze | microblazeel | mcore | mep | metag \\\n\t| mips | mipsbe | mipseb | mipsel | mipsle \\\n\t| mips16 \\\n\t| mips64 | mips64el \\\n\t| mips64octeon | mips64octeonel \\\n\t| mips64orion | mips64orionel \\\n\t| mips64r5900 | mips64r5900el \\\n\t| mips64vr | mips64vrel \\\n\t| mips64vr4100 | mips64vr4100el \\\n\t| mips64vr4300 | mips64vr4300el \\\n\t| mips64vr5000 | mips64vr5000el \\\n\t| mips64vr5900 | mips64vr5900el \\\n\t| mipsisa32 | mipsisa32el \\\n\t| mipsisa32r2 | mipsisa32r2el \\\n\t| mipsisa32r6 | mipsisa32r6el \\\n\t| mipsisa64 | mipsisa64el \\\n\t| mipsisa64r2 | mipsisa64r2el \\\n\t| mipsisa64r6 | mipsisa64r6el \\\n\t| mipsisa64sb1 | mipsisa64sb1el \\\n\t| mipsisa64sr71k | mipsisa64sr71kel \\\n\t| mipsr5900 | mipsr5900el \\\n\t| mipstx39 | mipstx39el \\\n\t| mn10200 | mn10300 \\\n\t| moxie \\\n\t| mt \\\n\t| msp430 \\\n\t| nds32 | nds32le | nds32be \\\n\t| nios | nios2 | nios2eb | nios2el \\\n\t| ns16k | ns32k \\\n\t| open8 | or1k | or1knd | or32 \\\n\t| pdp10 | pdp11 | pj | pjl \\\n\t| powerpc | powerpc64 | powerpc64le | powerpcle \\\n\t| pru \\\n\t| pyramid \\\n\t| riscv32 | riscv64 \\\n\t| rl78 | rx \\\n\t| score \\\n\t| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \\\n\t| sh64 | sh64le \\\n\t| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \\\n\t| sparcv8 | sparcv9 | sparcv9b | sparcv9v \\\n\t| spu \\\n\t| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \\\n\t| ubicom32 \\\n\t| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \\\n\t| visium \\\n\t| wasm32 \\\n\t| x86 | xc16x | xstormy16 | xtensa \\\n\t| z8k | z80)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\tc54x)\n\t\tbasic_machine=tic54x-unknown\n\t\t;;\n\tc55x)\n\t\tbasic_machine=tic55x-unknown\n\t\t;;\n\tc6x)\n\t\tbasic_machine=tic6x-unknown\n\t\t;;\n\tleon|leon[3-9])\n\t\tbasic_machine=sparc-$basic_machine\n\t\t;;\n\tm6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\tm88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)\n\t\t;;\n\tms1)\n\t\tbasic_machine=mt-unknown\n\t\t;;\n\n\tstrongarm | thumb | xscale)\n\t\tbasic_machine=arm-unknown\n\t\t;;\n\txgate)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\txscaleeb)\n\t\tbasic_machine=armeb-unknown\n\t\t;;\n\n\txscaleel)\n\t\tbasic_machine=armel-unknown\n\t\t;;\n\n\t# We use `pc' rather than `unknown'\n\t# because (1) that's what they normally are, and\n\t# (2) the word \"unknown\" tends to confuse beginning users.\n\ti*86 | x86_64)\n\t  basic_machine=$basic_machine-pc\n\t  ;;\n\t# Object if more than one company name word.\n\t*-*-*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\n\t# Recognize the basic CPU types with company name.\n\t580-* \\\n\t| a29k-* \\\n\t| aarch64-* | aarch64_be-* \\\n\t| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \\\n\t| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \\\n\t| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \\\n\t| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \\\n\t| avr-* | avr32-* \\\n\t| ba-* \\\n\t| be32-* | be64-* \\\n\t| bfin-* | bs2000-* \\\n\t| c[123]* | c30-* | [cjt]90-* | c4x-* \\\n\t| c8051-* | clipper-* | craynv-* | cydra-* \\\n\t| d10v-* | d30v-* | dlx-* \\\n\t| e2k-* | elxsi-* \\\n\t| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \\\n\t| h8300-* | h8500-* \\\n\t| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \\\n\t| hexagon-* \\\n\t| i*86-* | i860-* | i960-* | ia16-* | ia64-* \\\n\t| ip2k-* | iq2000-* \\\n\t| k1om-* \\\n\t| le32-* | le64-* \\\n\t| lm32-* \\\n\t| m32c-* | m32r-* | m32rle-* \\\n\t| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \\\n\t| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \\\n\t| microblaze-* | microblazeel-* \\\n\t| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \\\n\t| mips16-* \\\n\t| mips64-* | mips64el-* \\\n\t| mips64octeon-* | mips64octeonel-* \\\n\t| mips64orion-* | mips64orionel-* \\\n\t| mips64r5900-* | mips64r5900el-* \\\n\t| mips64vr-* | mips64vrel-* \\\n\t| mips64vr4100-* | mips64vr4100el-* \\\n\t| mips64vr4300-* | mips64vr4300el-* \\\n\t| mips64vr5000-* | mips64vr5000el-* \\\n\t| mips64vr5900-* | mips64vr5900el-* \\\n\t| mipsisa32-* | mipsisa32el-* \\\n\t| mipsisa32r2-* | mipsisa32r2el-* \\\n\t| mipsisa32r6-* | mipsisa32r6el-* \\\n\t| mipsisa64-* | mipsisa64el-* \\\n\t| mipsisa64r2-* | mipsisa64r2el-* \\\n\t| mipsisa64r6-* | mipsisa64r6el-* \\\n\t| mipsisa64sb1-* | mipsisa64sb1el-* \\\n\t| mipsisa64sr71k-* | mipsisa64sr71kel-* \\\n\t| mipsr5900-* | mipsr5900el-* \\\n\t| mipstx39-* | mipstx39el-* \\\n\t| mmix-* \\\n\t| mt-* \\\n\t| msp430-* \\\n\t| nds32-* | nds32le-* | nds32be-* \\\n\t| nios-* | nios2-* | nios2eb-* | nios2el-* \\\n\t| none-* | np1-* | ns16k-* | ns32k-* \\\n\t| open8-* \\\n\t| or1k*-* \\\n\t| orion-* \\\n\t| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \\\n\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \\\n\t| pru-* \\\n\t| pyramid-* \\\n\t| riscv32-* | riscv64-* \\\n\t| rl78-* | romp-* | rs6000-* | rx-* \\\n\t| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \\\n\t| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \\\n\t| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \\\n\t| sparclite-* \\\n\t| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \\\n\t| tahoe-* \\\n\t| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \\\n\t| tile*-* \\\n\t| tron-* \\\n\t| ubicom32-* \\\n\t| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \\\n\t| vax-* \\\n\t| visium-* \\\n\t| wasm32-* \\\n\t| we32k-* \\\n\t| x86-* | x86_64-* | xc16x-* | xps100-* \\\n\t| xstormy16-* | xtensa*-* \\\n\t| ymp-* \\\n\t| z8k-* | z80-*)\n\t\t;;\n\t# Recognize the basic CPU types without company name, with glob match.\n\txtensa*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\t# Recognize the various machine names and aliases which stand\n\t# for a CPU type and a company and sometimes even an OS.\n\t386bsd)\n\t\tbasic_machine=i386-unknown\n\t\tos=-bsd\n\t\t;;\n\t3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)\n\t\tbasic_machine=m68000-att\n\t\t;;\n\t3b*)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\ta29khif)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tabacus)\n\t\tbasic_machine=abacus-unknown\n\t\t;;\n\tadobe68k)\n\t\tbasic_machine=m68010-adobe\n\t\tos=-scout\n\t\t;;\n\talliant | fx80)\n\t\tbasic_machine=fx80-alliant\n\t\t;;\n\taltos | altos3068)\n\t\tbasic_machine=m68k-altos\n\t\t;;\n\tam29k)\n\t\tbasic_machine=a29k-none\n\t\tos=-bsd\n\t\t;;\n\tamd64)\n\t\tbasic_machine=x86_64-pc\n\t\t;;\n\tamd64-*)\n\t\tbasic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tamdahl)\n\t\tbasic_machine=580-amdahl\n\t\tos=-sysv\n\t\t;;\n\tamiga | amiga-*)\n\t\tbasic_machine=m68k-unknown\n\t\t;;\n\tamigaos | amigados)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-amigaos\n\t\t;;\n\tamigaunix | amix)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-sysv4\n\t\t;;\n\tapollo68)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-sysv\n\t\t;;\n\tapollo68bsd)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-bsd\n\t\t;;\n\taros)\n\t\tbasic_machine=i386-pc\n\t\tos=-aros\n\t\t;;\n\tasmjs)\n\t\tbasic_machine=asmjs-unknown\n\t\t;;\n\taux)\n\t\tbasic_machine=m68k-apple\n\t\tos=-aux\n\t\t;;\n\tbalance)\n\t\tbasic_machine=ns32k-sequent\n\t\tos=-dynix\n\t\t;;\n\tblackfin)\n\t\tbasic_machine=bfin-unknown\n\t\tos=-linux\n\t\t;;\n\tblackfin-*)\n\t\tbasic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tbluegene*)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-cnk\n\t\t;;\n\tc54x-*)\n\t\tbasic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc55x-*)\n\t\tbasic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc6x-*)\n\t\tbasic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc90)\n\t\tbasic_machine=c90-cray\n\t\tos=-unicos\n\t\t;;\n\tcegcc)\n\t\tbasic_machine=arm-unknown\n\t\tos=-cegcc\n\t\t;;\n\tconvex-c1)\n\t\tbasic_machine=c1-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c2)\n\t\tbasic_machine=c2-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c32)\n\t\tbasic_machine=c32-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c34)\n\t\tbasic_machine=c34-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c38)\n\t\tbasic_machine=c38-convex\n\t\tos=-bsd\n\t\t;;\n\tcray | j90)\n\t\tbasic_machine=j90-cray\n\t\tos=-unicos\n\t\t;;\n\tcraynv)\n\t\tbasic_machine=craynv-cray\n\t\tos=-unicosmp\n\t\t;;\n\tcr16 | cr16-*)\n\t\tbasic_machine=cr16-unknown\n\t\tos=-elf\n\t\t;;\n\tcrds | unos)\n\t\tbasic_machine=m68k-crds\n\t\t;;\n\tcrisv32 | crisv32-* | etraxfs*)\n\t\tbasic_machine=crisv32-axis\n\t\t;;\n\tcris | cris-* | etrax*)\n\t\tbasic_machine=cris-axis\n\t\t;;\n\tcrx)\n\t\tbasic_machine=crx-unknown\n\t\tos=-elf\n\t\t;;\n\tda30 | da30-*)\n\t\tbasic_machine=m68k-da30\n\t\t;;\n\tdecstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)\n\t\tbasic_machine=mips-dec\n\t\t;;\n\tdecsystem10* | dec10*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops10\n\t\t;;\n\tdecsystem20* | dec20*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops20\n\t\t;;\n\tdelta | 3300 | motorola-3300 | motorola-delta \\\n\t      | 3300-motorola | delta-motorola)\n\t\tbasic_machine=m68k-motorola\n\t\t;;\n\tdelta88)\n\t\tbasic_machine=m88k-motorola\n\t\tos=-sysv3\n\t\t;;\n\tdicos)\n\t\tbasic_machine=i686-pc\n\t\tos=-dicos\n\t\t;;\n\tdjgpp)\n\t\tbasic_machine=i586-pc\n\t\tos=-msdosdjgpp\n\t\t;;\n\tdpx20 | dpx20-*)\n\t\tbasic_machine=rs6000-bull\n\t\tos=-bosx\n\t\t;;\n\tdpx2*)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv3\n\t\t;;\n\te500v[12])\n\t\tbasic_machine=powerpc-unknown\n\t\tos=$os\"spe\"\n\t\t;;\n\te500v[12]-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=$os\"spe\"\n\t\t;;\n\tebmon29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-ebmon\n\t\t;;\n\telxsi)\n\t\tbasic_machine=elxsi-elxsi\n\t\tos=-bsd\n\t\t;;\n\tencore | umax | mmax)\n\t\tbasic_machine=ns32k-encore\n\t\t;;\n\tes1800 | OSE68k | ose68k | ose | OSE)\n\t\tbasic_machine=m68k-ericsson\n\t\tos=-ose\n\t\t;;\n\tfx2800)\n\t\tbasic_machine=i860-alliant\n\t\t;;\n\tgenix)\n\t\tbasic_machine=ns32k-ns\n\t\t;;\n\tgmicro)\n\t\tbasic_machine=tron-gmicro\n\t\tos=-sysv\n\t\t;;\n\tgo32)\n\t\tbasic_machine=i386-pc\n\t\tos=-go32\n\t\t;;\n\th3050r* | hiux*)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\th8300hms)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-hms\n\t\t;;\n\th8300xray)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-xray\n\t\t;;\n\th8500hms)\n\t\tbasic_machine=h8500-hitachi\n\t\tos=-hms\n\t\t;;\n\tharris)\n\t\tbasic_machine=m88k-harris\n\t\tos=-sysv3\n\t\t;;\n\thp300-*)\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp300bsd)\n\t\tbasic_machine=m68k-hp\n\t\tos=-bsd\n\t\t;;\n\thp300hpux)\n\t\tbasic_machine=m68k-hp\n\t\tos=-hpux\n\t\t;;\n\thp3k9[0-9][0-9] | hp9[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k2[0-9][0-9] | hp9k31[0-9])\n\t\tbasic_machine=m68000-hp\n\t\t;;\n\thp9k3[2-9][0-9])\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp9k6[0-9][0-9] | hp6[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k7[0-79][0-9] | hp7[0-79][0-9])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k78[0-9] | hp78[0-9])\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][13679] | hp8[0-9][13679])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][0-9] | hp8[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thppa-next)\n\t\tos=-nextstep3\n\t\t;;\n\thppaosf)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-osf\n\t\t;;\n\thppro)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-proelf\n\t\t;;\n\ti370-ibm* | ibm*)\n\t\tbasic_machine=i370-ibm\n\t\t;;\n\ti*86v32)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv32\n\t\t;;\n\ti*86v4*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv4\n\t\t;;\n\ti*86v)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv\n\t\t;;\n\ti*86sol2)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-solaris2\n\t\t;;\n\ti386mach)\n\t\tbasic_machine=i386-mach\n\t\tos=-mach\n\t\t;;\n\ti386-vsta | vsta)\n\t\tbasic_machine=i386-unknown\n\t\tos=-vsta\n\t\t;;\n\tiris | iris4d)\n\t\tbasic_machine=mips-sgi\n\t\tcase $os in\n\t\t    -irix*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-irix4\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tisi68 | isi)\n\t\tbasic_machine=m68k-isi\n\t\tos=-sysv\n\t\t;;\n\tleon-*|leon[3-9]-*)\n\t\tbasic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`\n\t\t;;\n\tm68knommu)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-linux\n\t\t;;\n\tm68knommu-*)\n\t\tbasic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tm88k-omron*)\n\t\tbasic_machine=m88k-omron\n\t\t;;\n\tmagnum | m3230)\n\t\tbasic_machine=mips-mips\n\t\tos=-sysv\n\t\t;;\n\tmerlin)\n\t\tbasic_machine=ns32k-utek\n\t\tos=-sysv\n\t\t;;\n\tmicroblaze*)\n\t\tbasic_machine=microblaze-xilinx\n\t\t;;\n\tmingw64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-mingw64\n\t\t;;\n\tmingw32)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\tmingw32ce)\n\t\tbasic_machine=arm-unknown\n\t\tos=-mingw32ce\n\t\t;;\n\tminiframe)\n\t\tbasic_machine=m68000-convergent\n\t\t;;\n\t*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\n\tmips3*-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`\n\t\t;;\n\tmips3*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown\n\t\t;;\n\tmonitor)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\tmorphos)\n\t\tbasic_machine=powerpc-unknown\n\t\tos=-morphos\n\t\t;;\n\tmoxiebox)\n\t\tbasic_machine=moxie-unknown\n\t\tos=-moxiebox\n\t\t;;\n\tmsdos)\n\t\tbasic_machine=i386-pc\n\t\tos=-msdos\n\t\t;;\n\tms1-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`\n\t\t;;\n\tmsys)\n\t\tbasic_machine=i686-pc\n\t\tos=-msys\n\t\t;;\n\tmvs)\n\t\tbasic_machine=i370-ibm\n\t\tos=-mvs\n\t\t;;\n\tnacl)\n\t\tbasic_machine=le32-unknown\n\t\tos=-nacl\n\t\t;;\n\tncr3000)\n\t\tbasic_machine=i486-ncr\n\t\tos=-sysv4\n\t\t;;\n\tnetbsd386)\n\t\tbasic_machine=i386-unknown\n\t\tos=-netbsd\n\t\t;;\n\tnetwinder)\n\t\tbasic_machine=armv4l-rebel\n\t\tos=-linux\n\t\t;;\n\tnews | news700 | news800 | news900)\n\t\tbasic_machine=m68k-sony\n\t\tos=-newsos\n\t\t;;\n\tnews1000)\n\t\tbasic_machine=m68030-sony\n\t\tos=-newsos\n\t\t;;\n\tnews-3600 | risc-news)\n\t\tbasic_machine=mips-sony\n\t\tos=-newsos\n\t\t;;\n\tnecv70)\n\t\tbasic_machine=v70-nec\n\t\tos=-sysv\n\t\t;;\n\tnext | m*-next)\n\t\tbasic_machine=m68k-next\n\t\tcase $os in\n\t\t    -nextstep* )\n\t\t\t;;\n\t\t    -ns2*)\n\t\t      os=-nextstep2\n\t\t\t;;\n\t\t    *)\n\t\t      os=-nextstep3\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tnh3000)\n\t\tbasic_machine=m68k-harris\n\t\tos=-cxux\n\t\t;;\n\tnh[45]000)\n\t\tbasic_machine=m88k-harris\n\t\tos=-cxux\n\t\t;;\n\tnindy960)\n\t\tbasic_machine=i960-intel\n\t\tos=-nindy\n\t\t;;\n\tmon960)\n\t\tbasic_machine=i960-intel\n\t\tos=-mon960\n\t\t;;\n\tnonstopux)\n\t\tbasic_machine=mips-compaq\n\t\tos=-nonstopux\n\t\t;;\n\tnp1)\n\t\tbasic_machine=np1-gould\n\t\t;;\n\tneo-tandem)\n\t\tbasic_machine=neo-tandem\n\t\t;;\n\tnse-tandem)\n\t\tbasic_machine=nse-tandem\n\t\t;;\n\tnsr-tandem)\n\t\tbasic_machine=nsr-tandem\n\t\t;;\n\tnsx-tandem)\n\t\tbasic_machine=nsx-tandem\n\t\t;;\n\top50n-* | op60c-*)\n\t\tbasic_machine=hppa1.1-oki\n\t\tos=-proelf\n\t\t;;\n\topenrisc | openrisc-*)\n\t\tbasic_machine=or32-unknown\n\t\t;;\n\tos400)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-os400\n\t\t;;\n\tOSE68000 | ose68000)\n\t\tbasic_machine=m68000-ericsson\n\t\tos=-ose\n\t\t;;\n\tos68k)\n\t\tbasic_machine=m68k-none\n\t\tos=-os68k\n\t\t;;\n\tpa-hitachi)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\tparagon)\n\t\tbasic_machine=i860-intel\n\t\tos=-osf\n\t\t;;\n\tparisc)\n\t\tbasic_machine=hppa-unknown\n\t\tos=-linux\n\t\t;;\n\tparisc-*)\n\t\tbasic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tpbd)\n\t\tbasic_machine=sparc-tti\n\t\t;;\n\tpbb)\n\t\tbasic_machine=m68k-tti\n\t\t;;\n\tpc532 | pc532-*)\n\t\tbasic_machine=ns32k-pc532\n\t\t;;\n\tpc98)\n\t\tbasic_machine=i386-pc\n\t\t;;\n\tpc98-*)\n\t\tbasic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium | p5 | k5 | k6 | nexgen | viac3)\n\t\tbasic_machine=i586-pc\n\t\t;;\n\tpentiumpro | p6 | 6x86 | athlon | athlon_*)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentiumii | pentium2 | pentiumiii | pentium3)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentium4)\n\t\tbasic_machine=i786-pc\n\t\t;;\n\tpentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)\n\t\tbasic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumpro-* | p6-* | 6x86-* | athlon-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium4-*)\n\t\tbasic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpn)\n\t\tbasic_machine=pn-gould\n\t\t;;\n\tpower)\tbasic_machine=power-ibm\n\t\t;;\n\tppc | ppcbe)\tbasic_machine=powerpc-unknown\n\t\t;;\n\tppc-* | ppcbe-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppcle | powerpclittle)\n\t\tbasic_machine=powerpcle-unknown\n\t\t;;\n\tppcle-* | powerpclittle-*)\n\t\tbasic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64)\tbasic_machine=powerpc64-unknown\n\t\t;;\n\tppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64le | powerpc64little)\n\t\tbasic_machine=powerpc64le-unknown\n\t\t;;\n\tppc64le-* | powerpc64little-*)\n\t\tbasic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tps2)\n\t\tbasic_machine=i386-ibm\n\t\t;;\n\tpw32)\n\t\tbasic_machine=i586-unknown\n\t\tos=-pw32\n\t\t;;\n\trdos | rdos64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-rdos\n\t\t;;\n\trdos32)\n\t\tbasic_machine=i386-pc\n\t\tos=-rdos\n\t\t;;\n\trom68k)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\trm[46]00)\n\t\tbasic_machine=mips-siemens\n\t\t;;\n\trtpc | rtpc-*)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\ts390 | s390-*)\n\t\tbasic_machine=s390-ibm\n\t\t;;\n\ts390x | s390x-*)\n\t\tbasic_machine=s390x-ibm\n\t\t;;\n\tsa29200)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tsb1)\n\t\tbasic_machine=mipsisa64sb1-unknown\n\t\t;;\n\tsb1el)\n\t\tbasic_machine=mipsisa64sb1el-unknown\n\t\t;;\n\tsde)\n\t\tbasic_machine=mipsisa32-sde\n\t\tos=-elf\n\t\t;;\n\tsei)\n\t\tbasic_machine=mips-sei\n\t\tos=-seiux\n\t\t;;\n\tsequent)\n\t\tbasic_machine=i386-sequent\n\t\t;;\n\tsh)\n\t\tbasic_machine=sh-hitachi\n\t\tos=-hms\n\t\t;;\n\tsh5el)\n\t\tbasic_machine=sh5le-unknown\n\t\t;;\n\tsh64)\n\t\tbasic_machine=sh64-unknown\n\t\t;;\n\tsparclite-wrs | simso-wrs)\n\t\tbasic_machine=sparclite-wrs\n\t\tos=-vxworks\n\t\t;;\n\tsps7)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv2\n\t\t;;\n\tspur)\n\t\tbasic_machine=spur-unknown\n\t\t;;\n\tst2000)\n\t\tbasic_machine=m68k-tandem\n\t\t;;\n\tstratus)\n\t\tbasic_machine=i860-stratus\n\t\tos=-sysv4\n\t\t;;\n\tstrongarm-* | thumb-*)\n\t\tbasic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tsun2)\n\t\tbasic_machine=m68000-sun\n\t\t;;\n\tsun2os3)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun2os4)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun3os3)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun3os4)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4os3)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun4os4)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4sol2)\n\t\tbasic_machine=sparc-sun\n\t\tos=-solaris2\n\t\t;;\n\tsun3 | sun3-*)\n\t\tbasic_machine=m68k-sun\n\t\t;;\n\tsun4)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tsun386 | sun386i | roadrunner)\n\t\tbasic_machine=i386-sun\n\t\t;;\n\tsv1)\n\t\tbasic_machine=sv1-cray\n\t\tos=-unicos\n\t\t;;\n\tsymmetry)\n\t\tbasic_machine=i386-sequent\n\t\tos=-dynix\n\t\t;;\n\tt3e)\n\t\tbasic_machine=alphaev5-cray\n\t\tos=-unicos\n\t\t;;\n\tt90)\n\t\tbasic_machine=t90-cray\n\t\tos=-unicos\n\t\t;;\n\ttile*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-linux-gnu\n\t\t;;\n\ttx39)\n\t\tbasic_machine=mipstx39-unknown\n\t\t;;\n\ttx39el)\n\t\tbasic_machine=mipstx39el-unknown\n\t\t;;\n\ttoad1)\n\t\tbasic_machine=pdp10-xkl\n\t\tos=-tops20\n\t\t;;\n\ttower | tower-32)\n\t\tbasic_machine=m68k-ncr\n\t\t;;\n\ttpf)\n\t\tbasic_machine=s390x-ibm\n\t\tos=-tpf\n\t\t;;\n\tudi29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tultra3)\n\t\tbasic_machine=a29k-nyu\n\t\tos=-sym1\n\t\t;;\n\tv810 | necv810)\n\t\tbasic_machine=v810-nec\n\t\tos=-none\n\t\t;;\n\tvaxv)\n\t\tbasic_machine=vax-dec\n\t\tos=-sysv\n\t\t;;\n\tvms)\n\t\tbasic_machine=vax-dec\n\t\tos=-vms\n\t\t;;\n\tvpp*|vx|vx-*)\n\t\tbasic_machine=f301-fujitsu\n\t\t;;\n\tvxworks960)\n\t\tbasic_machine=i960-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks68)\n\t\tbasic_machine=m68k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks29k)\n\t\tbasic_machine=a29k-wrs\n\t\tos=-vxworks\n\t\t;;\n\twasm32)\n\t\tbasic_machine=wasm32-unknown\n\t\t;;\n\tw65*)\n\t\tbasic_machine=w65-wdc\n\t\tos=-none\n\t\t;;\n\tw89k-*)\n\t\tbasic_machine=hppa1.1-winbond\n\t\tos=-proelf\n\t\t;;\n\tx64)\n\t\tbasic_machine=x86_64-pc\n\t\t;;\n\txbox)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\txps | xps100)\n\t\tbasic_machine=xps100-honeywell\n\t\t;;\n\txscale-* | xscalee[bl]-*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`\n\t\t;;\n\tymp)\n\t\tbasic_machine=ymp-cray\n\t\tos=-unicos\n\t\t;;\n\tz8k-*-coff)\n\t\tbasic_machine=z8k-unknown\n\t\tos=-sim\n\t\t;;\n\tz80-*-coff)\n\t\tbasic_machine=z80-unknown\n\t\tos=-sim\n\t\t;;\n\tnone)\n\t\tbasic_machine=none-none\n\t\tos=-none\n\t\t;;\n\n# Here we handle the default manufacturer of certain CPU types.  It is in\n# some cases the only manufacturer, in others, it is the most popular.\n\tw89k)\n\t\tbasic_machine=hppa1.1-winbond\n\t\t;;\n\top50n)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\top60c)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\tromp)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\tmmix)\n\t\tbasic_machine=mmix-knuth\n\t\t;;\n\trs6000)\n\t\tbasic_machine=rs6000-ibm\n\t\t;;\n\tvax)\n\t\tbasic_machine=vax-dec\n\t\t;;\n\tpdp10)\n\t\t# there are many clones, so DEC is not a safe bet\n\t\tbasic_machine=pdp10-unknown\n\t\t;;\n\tpdp11)\n\t\tbasic_machine=pdp11-dec\n\t\t;;\n\twe32k)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\tsh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)\n\t\tbasic_machine=sh-unknown\n\t\t;;\n\tsparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tcydra)\n\t\tbasic_machine=cydra-cydrome\n\t\t;;\n\torion)\n\t\tbasic_machine=orion-highlevel\n\t\t;;\n\torion105)\n\t\tbasic_machine=clipper-highlevel\n\t\t;;\n\tmac | mpw | mac-mpw)\n\t\tbasic_machine=m68k-apple\n\t\t;;\n\tpmac | pmac-mpw)\n\t\tbasic_machine=powerpc-apple\n\t\t;;\n\t*-unknown)\n\t\t# Make sure to match an already-canonicalized machine name.\n\t\t;;\n\t*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\n\n# Here we canonicalize certain aliases for manufacturers.\ncase $basic_machine in\n\t*-digital*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`\n\t\t;;\n\t*-commodore*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`\n\t\t;;\n\t*)\n\t\t;;\nesac\n\n# Decode manufacturer-specific aliases for certain operating systems.\n\nif [ x\"$os\" != x\"\" ]\nthen\ncase $os in\n\t# First match some system type aliases that might get confused\n\t# with valid system types.\n\t# -solaris* is a basic system type, with this one exception.\n\t-auroraux)\n\t\tos=-auroraux\n\t\t;;\n\t-solaris1 | -solaris1.*)\n\t\tos=`echo $os | sed -e 's|solaris1|sunos4|'`\n\t\t;;\n\t-solaris)\n\t\tos=-solaris2\n\t\t;;\n\t-svr4*)\n\t\tos=-sysv4\n\t\t;;\n\t-unixware*)\n\t\tos=-sysv4.2uw\n\t\t;;\n\t-gnu/linux*)\n\t\tos=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`\n\t\t;;\n\t# Now accept the basic system types.\n\t# The portable systems comes first.\n\t# Each alternative MUST end in a * to match a version number.\n\t# -sysv* is not here because it comes later, after sysvr4.\n\t-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \\\n\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\\\n\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \\\n\t      | -sym* | -kopensolaris* | -plan9* \\\n\t      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \\\n\t      | -aos* | -aros* | -cloudabi* | -sortix* \\\n\t      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \\\n\t      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \\\n\t      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \\\n\t      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \\\n\t      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \\\n\t      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \\\n\t      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \\\n\t      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \\\n\t      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \\\n\t      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n\t      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \\\n\t      | -linux-newlib* | -linux-musl* | -linux-uclibc* \\\n\t      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \\\n\t      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \\\n\t      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \\\n\t      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \\\n\t      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \\\n\t      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \\\n\t      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \\\n\t      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \\\n\t      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)\n\t# Remember, each alternative MUST END IN *, to match a version number.\n\t\t;;\n\t-qnx*)\n\t\tcase $basic_machine in\n\t\t    x86-* | i*86-*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-nto$os\n\t\t\t;;\n\t\tesac\n\t\t;;\n\t-nto-qnx*)\n\t\t;;\n\t-nto*)\n\t\tos=`echo $os | sed -e 's|nto|nto-qnx|'`\n\t\t;;\n\t-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \\\n\t      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \\\n\t      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)\n\t\t;;\n\t-mac*)\n\t\tos=`echo $os | sed -e 's|mac|macos|'`\n\t\t;;\n\t-linux-dietlibc)\n\t\tos=-linux-dietlibc\n\t\t;;\n\t-linux*)\n\t\tos=`echo $os | sed -e 's|linux|linux-gnu|'`\n\t\t;;\n\t-sunos5*)\n\t\tos=`echo $os | sed -e 's|sunos5|solaris2|'`\n\t\t;;\n\t-sunos6*)\n\t\tos=`echo $os | sed -e 's|sunos6|solaris3|'`\n\t\t;;\n\t-opened*)\n\t\tos=-openedition\n\t\t;;\n\t-os400*)\n\t\tos=-os400\n\t\t;;\n\t-wince*)\n\t\tos=-wince\n\t\t;;\n\t-osfrose*)\n\t\tos=-osfrose\n\t\t;;\n\t-osf*)\n\t\tos=-osf\n\t\t;;\n\t-utek*)\n\t\tos=-bsd\n\t\t;;\n\t-dynix*)\n\t\tos=-bsd\n\t\t;;\n\t-acis*)\n\t\tos=-aos\n\t\t;;\n\t-atheos*)\n\t\tos=-atheos\n\t\t;;\n\t-syllable*)\n\t\tos=-syllable\n\t\t;;\n\t-386bsd)\n\t\tos=-bsd\n\t\t;;\n\t-ctix* | -uts*)\n\t\tos=-sysv\n\t\t;;\n\t-nova*)\n\t\tos=-rtmk-nova\n\t\t;;\n\t-ns2)\n\t\tos=-nextstep2\n\t\t;;\n\t-nsk*)\n\t\tos=-nsk\n\t\t;;\n\t# Preserve the version number of sinix5.\n\t-sinix5.*)\n\t\tos=`echo $os | sed -e 's|sinix|sysv|'`\n\t\t;;\n\t-sinix*)\n\t\tos=-sysv4\n\t\t;;\n\t-tpf*)\n\t\tos=-tpf\n\t\t;;\n\t-triton*)\n\t\tos=-sysv3\n\t\t;;\n\t-oss*)\n\t\tos=-sysv3\n\t\t;;\n\t-svr4)\n\t\tos=-sysv4\n\t\t;;\n\t-svr3)\n\t\tos=-sysv3\n\t\t;;\n\t-sysvr4)\n\t\tos=-sysv4\n\t\t;;\n\t# This must come after -sysvr4.\n\t-sysv*)\n\t\t;;\n\t-ose*)\n\t\tos=-ose\n\t\t;;\n\t-es1800*)\n\t\tos=-ose\n\t\t;;\n\t-xenix)\n\t\tos=-xenix\n\t\t;;\n\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\tos=-mint\n\t\t;;\n\t-aros*)\n\t\tos=-aros\n\t\t;;\n\t-zvmoe)\n\t\tos=-zvmoe\n\t\t;;\n\t-dicos*)\n\t\tos=-dicos\n\t\t;;\n\t-pikeos*)\n\t\t# Until real need of OS specific support for\n\t\t# particular features comes up, bare metal\n\t\t# configurations are quite functional.\n\t\tcase $basic_machine in\n\t\t    arm*)\n\t\t\tos=-eabi\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-elf\n\t\t\t;;\n\t\tesac\n\t\t;;\n\t-nacl*)\n\t\t;;\n\t-ios)\n\t\t;;\n\t-none)\n\t\t;;\n\t*)\n\t\t# Get rid of the `-' at the beginning of $os.\n\t\tos=`echo $os | sed 's/[^-]*-//'`\n\t\techo Invalid configuration \\`$1\\': system \\`$os\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\nelse\n\n# Here we handle the default operating systems that come with various machines.\n# The value should be what the vendor currently ships out the door with their\n# machine or put another way, the most popular os provided with the machine.\n\n# Note that if you're going to try to match \"-MANUFACTURER\" here (say,\n# \"-sun\"), then you have to tell the case statement up towards the top\n# that MANUFACTURER isn't an operating system.  Otherwise, code above\n# will signal an error saying that MANUFACTURER isn't an operating\n# system, and we'll never get to this point.\n\ncase $basic_machine in\n\tscore-*)\n\t\tos=-elf\n\t\t;;\n\tspu-*)\n\t\tos=-elf\n\t\t;;\n\t*-acorn)\n\t\tos=-riscix1.2\n\t\t;;\n\tarm*-rebel)\n\t\tos=-linux\n\t\t;;\n\tarm*-semi)\n\t\tos=-aout\n\t\t;;\n\tc4x-* | tic4x-*)\n\t\tos=-coff\n\t\t;;\n\tc8051-*)\n\t\tos=-elf\n\t\t;;\n\thexagon-*)\n\t\tos=-elf\n\t\t;;\n\ttic54x-*)\n\t\tos=-coff\n\t\t;;\n\ttic55x-*)\n\t\tos=-coff\n\t\t;;\n\ttic6x-*)\n\t\tos=-coff\n\t\t;;\n\t# This must come before the *-dec entry.\n\tpdp10-*)\n\t\tos=-tops20\n\t\t;;\n\tpdp11-*)\n\t\tos=-none\n\t\t;;\n\t*-dec | vax-*)\n\t\tos=-ultrix4.2\n\t\t;;\n\tm68*-apollo)\n\t\tos=-domain\n\t\t;;\n\ti386-sun)\n\t\tos=-sunos4.0.2\n\t\t;;\n\tm68000-sun)\n\t\tos=-sunos3\n\t\t;;\n\tm68*-cisco)\n\t\tos=-aout\n\t\t;;\n\tmep-*)\n\t\tos=-elf\n\t\t;;\n\tmips*-cisco)\n\t\tos=-elf\n\t\t;;\n\tmips*-*)\n\t\tos=-elf\n\t\t;;\n\tor32-*)\n\t\tos=-coff\n\t\t;;\n\t*-tti)\t# must be before sparc entry or we get the wrong os.\n\t\tos=-sysv3\n\t\t;;\n\tsparc-* | *-sun)\n\t\tos=-sunos4.1.1\n\t\t;;\n\tpru-*)\n\t\tos=-elf\n\t\t;;\n\t*-be)\n\t\tos=-beos\n\t\t;;\n\t*-haiku)\n\t\tos=-haiku\n\t\t;;\n\t*-ibm)\n\t\tos=-aix\n\t\t;;\n\t*-knuth)\n\t\tos=-mmixware\n\t\t;;\n\t*-wec)\n\t\tos=-proelf\n\t\t;;\n\t*-winbond)\n\t\tos=-proelf\n\t\t;;\n\t*-oki)\n\t\tos=-proelf\n\t\t;;\n\t*-hp)\n\t\tos=-hpux\n\t\t;;\n\t*-hitachi)\n\t\tos=-hiux\n\t\t;;\n\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n\t\tos=-sysv\n\t\t;;\n\t*-cbm)\n\t\tos=-amigaos\n\t\t;;\n\t*-dg)\n\t\tos=-dgux\n\t\t;;\n\t*-dolphin)\n\t\tos=-sysv3\n\t\t;;\n\tm68k-ccur)\n\t\tos=-rtu\n\t\t;;\n\tm88k-omron*)\n\t\tos=-luna\n\t\t;;\n\t*-next)\n\t\tos=-nextstep\n\t\t;;\n\t*-sequent)\n\t\tos=-ptx\n\t\t;;\n\t*-crds)\n\t\tos=-unos\n\t\t;;\n\t*-ns)\n\t\tos=-genix\n\t\t;;\n\ti370-*)\n\t\tos=-mvs\n\t\t;;\n\t*-next)\n\t\tos=-nextstep3\n\t\t;;\n\t*-gould)\n\t\tos=-sysv\n\t\t;;\n\t*-highlevel)\n\t\tos=-bsd\n\t\t;;\n\t*-encore)\n\t\tos=-bsd\n\t\t;;\n\t*-sgi)\n\t\tos=-irix\n\t\t;;\n\t*-siemens)\n\t\tos=-sysv4\n\t\t;;\n\t*-masscomp)\n\t\tos=-rtu\n\t\t;;\n\tf30[01]-fujitsu | f700-fujitsu)\n\t\tos=-uxpv\n\t\t;;\n\t*-rom68k)\n\t\tos=-coff\n\t\t;;\n\t*-*bug)\n\t\tos=-coff\n\t\t;;\n\t*-apple)\n\t\tos=-macos\n\t\t;;\n\t*-atari*)\n\t\tos=-mint\n\t\t;;\n\t*)\n\t\tos=-none\n\t\t;;\nesac\nfi\n\n# Here we handle the case where we know the os, and the CPU type, but not the\n# manufacturer.  We pick the logical manufacturer.\nvendor=unknown\ncase $basic_machine in\n\t*-unknown)\n\t\tcase $os in\n\t\t\t-riscix*)\n\t\t\t\tvendor=acorn\n\t\t\t\t;;\n\t\t\t-sunos*)\n\t\t\t\tvendor=sun\n\t\t\t\t;;\n\t\t\t-cnk*|-aix*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-beos*)\n\t\t\t\tvendor=be\n\t\t\t\t;;\n\t\t\t-hpux*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-mpeix*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-hiux*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-unos*)\n\t\t\t\tvendor=crds\n\t\t\t\t;;\n\t\t\t-dgux*)\n\t\t\t\tvendor=dg\n\t\t\t\t;;\n\t\t\t-luna*)\n\t\t\t\tvendor=omron\n\t\t\t\t;;\n\t\t\t-genix*)\n\t\t\t\tvendor=ns\n\t\t\t\t;;\n\t\t\t-mvs* | -opened*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-os400*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-ptx*)\n\t\t\t\tvendor=sequent\n\t\t\t\t;;\n\t\t\t-tpf*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-vxsim* | -vxworks* | -windiss*)\n\t\t\t\tvendor=wrs\n\t\t\t\t;;\n\t\t\t-aux*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-hms*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-mpw* | -macos*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\t\t\tvendor=atari\n\t\t\t\t;;\n\t\t\t-vos*)\n\t\t\t\tvendor=stratus\n\t\t\t\t;;\n\t\tesac\n\t\tbasic_machine=`echo $basic_machine | sed \"s/unknown/$vendor/\"`\n\t\t;;\nesac\n\necho $basic_machine$os\nexit\n\n# Local variables:\n# eval: (add-hook 'write-file-functions 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "configure",
    "content": "#! /bin/sh\n# Guess values for system-dependent variables and create Makefiles.\n# Generated by GNU Autoconf 2.72 for pgreplay 1.5.0.\n#\n# Report bugs to <https://github.com/laurenz/pgreplay/issues>.\n#\n#\n# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation,\n# Inc.\n#\n#\n# This configure script is free software; the Free Software Foundation\n# gives unlimited permission to copy, distribute and modify it.\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nif test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1\nthen :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse case e in #(\n  e) case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac ;;\nesac\nfi\n\n\n\n# Reset variables that may have inherited troublesome values from\n# the environment.\n\n# IFS needs to be set, to space, tab, and newline, in precisely that order.\n# (If _AS_PATH_WALK were called with IFS unset, it would have the\n# side effect of setting IFS to empty, thus disabling word splitting.)\n# Quoting is to prevent editors from complaining about space-tab.\nas_nl='\n'\nexport as_nl\nIFS=\" \"\"\t$as_nl\"\n\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# Ensure predictable behavior from utilities with locale-dependent output.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# We cannot yet rely on \"unset\" to work, but we need these variables\n# to be unset--not just set to an empty or harmless value--now, to\n# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct\n# also avoids known problems related to \"unset\" and subshell syntax\n# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).\nfor as_var in BASH_ENV ENV MAIL MAILPATH CDPATH\ndo eval test \\${$as_var+y} \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\n\n# Ensure that fds 0, 1, and 2 are open.\nif (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi\nif (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi\nif (exec 3>&2)            ; then :; else exec 2>/dev/null; fi\n\n# The user is always right.\nif ${PATH_SEPARATOR+false} :; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    test -r \"$as_dir$0\" && as_myself=$as_dir$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as 'sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  printf \"%s\\n\" \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n\n# Use a proper internal environment variable to ensure we don't fall\n  # into an infinite loop, continuously re-executing ourselves.\n  if test x\"${_as_can_reexec}\" != xno && test \"x$CONFIG_SHELL\" != x; then\n    _as_can_reexec=no; export _as_can_reexec;\n    # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed 'exec'.\nprintf \"%s\\n\" \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nexit 255\n  fi\n  # We don't want this to propagate to other subprocesses.\n          { _as_can_reexec=; unset _as_can_reexec;}\nif test \"x$CONFIG_SHELL\" = x; then\n  as_bourne_compatible=\"if test \\${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1\nthen :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on \\${1+\\\"\\$@\\\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '\\${1+\\\"\\$@\\\"}'='\\\"\\$@\\\"'\n  setopt NO_GLOB_SUBST\nelse case e in #(\n  e) case \\`(set -o) 2>/dev/null\\` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac ;;\nesac\nfi\n\"\n  as_required=\"as_fn_return () { (exit \\$1); }\nas_fn_success () { as_fn_return 0; }\nas_fn_failure () { as_fn_return 1; }\nas_fn_ret_success () { return 0; }\nas_fn_ret_failure () { return 1; }\n\nexitcode=0\nas_fn_success || { exitcode=1; echo as_fn_success failed.; }\nas_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }\nas_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }\nas_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }\nif ( set x; as_fn_ret_success y && test x = \\\"\\$1\\\" )\nthen :\n\nelse case e in #(\n  e) exitcode=1; echo positional parameters were not saved. ;;\nesac\nfi\ntest x\\$exitcode = x0 || exit 1\nblah=\\$(echo \\$(echo blah))\ntest x\\\"\\$blah\\\" = xblah || exit 1\ntest -x / || exit 1\"\n  as_suggested=\"  as_lineno_1=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_1a=\\$LINENO\n  as_lineno_2=\";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested\" as_lineno_2a=\\$LINENO\n  eval 'test \\\"x\\$as_lineno_1'\\$as_run'\\\" != \\\"x\\$as_lineno_2'\\$as_run'\\\" &&\n  test \\\"x\\`expr \\$as_lineno_1'\\$as_run' + 1\\`\\\" = \\\"x\\$as_lineno_2'\\$as_run'\\\"' || exit 1\ntest \\$(( 1 + 1 )) = 2 || exit 1\"\n  if (eval \"$as_required\") 2>/dev/null\nthen :\n  as_have_required=yes\nelse case e in #(\n  e) as_have_required=no ;;\nesac\nfi\n  if test x$as_have_required = xyes && (eval \"$as_suggested\") 2>/dev/null\nthen :\n\nelse case e in #(\n  e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nas_found=false\nfor as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n  as_found=:\n  case $as_dir in #(\n\t /*)\n\t   for as_base in sh bash ksh sh5; do\n\t     # Try only shells that exist, to save several forks.\n\t     as_shell=$as_dir$as_base\n\t     if { test -f \"$as_shell\" || test -f \"$as_shell.exe\"; } &&\n\t\t    as_run=a \"$as_shell\" -c \"$as_bourne_compatible\"\"$as_required\" 2>/dev/null\nthen :\n  CONFIG_SHELL=$as_shell as_have_required=yes\n\t\t   if as_run=a \"$as_shell\" -c \"$as_bourne_compatible\"\"$as_suggested\" 2>/dev/null\nthen :\n  break 2\nfi\nfi\n\t   done;;\n       esac\n  as_found=false\ndone\nIFS=$as_save_IFS\nif $as_found\nthen :\n\nelse case e in #(\n  e) if { test -f \"$SHELL\" || test -f \"$SHELL.exe\"; } &&\n\t      as_run=a \"$SHELL\" -c \"$as_bourne_compatible\"\"$as_required\" 2>/dev/null\nthen :\n  CONFIG_SHELL=$SHELL as_have_required=yes\nfi ;;\nesac\nfi\n\n\n      if test \"x$CONFIG_SHELL\" != x\nthen :\n  export CONFIG_SHELL\n             # We cannot yet assume a decent shell, so we have to provide a\n# neutralization value for shells without unset; and this also\n# works around shells that cannot unset nonexistent variables.\n# Preserve -v and -x to the replacement shell.\nBASH_ENV=/dev/null\nENV=/dev/null\n(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV\ncase $- in # ((((\n  *v*x* | *x*v* ) as_opts=-vx ;;\n  *v* ) as_opts=-v ;;\n  *x* ) as_opts=-x ;;\n  * ) as_opts= ;;\nesac\nexec $CONFIG_SHELL $as_opts \"$as_myself\" ${1+\"$@\"}\n# Admittedly, this is quite paranoid, since all the known shells bail\n# out after a failed 'exec'.\nprintf \"%s\\n\" \"$0: could not re-execute with $CONFIG_SHELL\" >&2\nexit 255\nfi\n\n    if test x$as_have_required = xno\nthen :\n  printf \"%s\\n\" \"$0: This script requires a shell more modern than all\"\n  printf \"%s\\n\" \"$0: the shells that I found on your system.\"\n  if test ${ZSH_VERSION+y} ; then\n    printf \"%s\\n\" \"$0: In particular, zsh $ZSH_VERSION has bugs and should\"\n    printf \"%s\\n\" \"$0: be upgraded to zsh 4.3.4 or later.\"\n  else\n    printf \"%s\\n\" \"$0: Please tell bug-autoconf@gnu.org and\n$0: https://github.com/laurenz/pgreplay/issues about your\n$0: system, including any error possibly output before this\n$0: message. Then install a modern shell, or manually run\n$0: the script under such a shell if you do have one.\"\n  fi\n  exit 1\nfi ;;\nesac\nfi\nfi\nSHELL=${CONFIG_SHELL-/bin/sh}\nexport SHELL\n# Unset more variables known to interfere with behavior of common tools.\nCLICOLOR_FORCE= GREP_OPTIONS=\nunset CLICOLOR_FORCE GREP_OPTIONS\n\n## --------------------- ##\n## M4sh Shell Functions. ##\n## --------------------- ##\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`printf \"%s\\n\" \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null\nthen :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse case e in #(\n  e) as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  } ;;\nesac\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null\nthen :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse case e in #(\n  e) as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  } ;;\nesac\nfi # as_fn_arith\n\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  printf \"%s\\n\" \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n\n  as_lineno_1=$LINENO as_lineno_1a=$LINENO\n  as_lineno_2=$LINENO as_lineno_2a=$LINENO\n  eval 'test \"x$as_lineno_1'$as_run'\" != \"x$as_lineno_2'$as_run'\" &&\n  test \"x`expr $as_lineno_1'$as_run' + 1`\" = \"x$as_lineno_2'$as_run'\"' || {\n  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)\n  sed -n '\n    p\n    /[$]LINENO/=\n  ' <$as_myself |\n    sed '\n      t clear\n      :clear\n      s/[$]LINENO.*/&-/\n      t lineno\n      b\n      :lineno\n      N\n      :loop\n      s/[$]LINENO\\([^'$as_cr_alnum'_].*\\n\\)\\(.*\\)/\\2\\1\\2/\n      t loop\n      s/-\\n.*//\n    ' >$as_me.lineno &&\n  chmod +x \"$as_me.lineno\" ||\n    { printf \"%s\\n\" \"$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell\" >&2; as_fn_exit 1; }\n\n  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have\n  # already done that, so ensure we don't try to do so again and fall\n  # in an infinite loop.  This has already happened in practice.\n  _as_can_reexec=no; export _as_can_reexec\n  # Don't try to exec as it changes $[0], causing all sort of problems\n  # (the dirname of $[0] is not the place where we might find the\n  # original and so on.  Autoconf is especially sensitive to this).\n  . \"./$as_me.lineno\"\n  # Exit status is that of the last command.\n  exit\n}\n\n\n# Determine whether it's possible to make 'echo' print without a newline.\n# These variables are no longer used directly by Autoconf, but are AC_SUBSTed\n# for compatibility with existing Makefiles.\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\n# For backward compatibility with old third-party macros, we provide\n# the shell variables $as_echo and $as_echo_n.  New code should use\n# AS_ECHO([\"message\"]) and AS_ECHO_N([\"message\"]), respectively.\nas_echo='printf %s\\n'\nas_echo_n='printf %s'\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.\n    # In both cases, we have to default to 'cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_sed_cpp=\"y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g\"\nas_tr_cpp=\"eval sed '$as_sed_cpp'\" # deprecated\n\n# Sed expression to map a string onto a valid variable name.\nas_sed_sh=\"y%*+%pp%;s%[^_$as_cr_alnum]%_%g\"\nas_tr_sh=\"eval sed '$as_sed_sh'\" # deprecated\n\n\ntest -n \"$DJDIR\" || exec 7<&0 </dev/null\nexec 6>&1\n\n# Name of the host.\n# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,\n# so uname gets run too.\nac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`\n\n#\n# Initializations.\n#\nac_default_prefix=/usr/local\nac_clean_files=\nac_config_libobj_dir=.\nLIBOBJS=\ncross_compiling=no\nsubdirs=\nMFLAGS=\nMAKEFLAGS=\n\n# Identity of this package.\nPACKAGE_NAME='pgreplay'\nPACKAGE_TARNAME='pgreplay'\nPACKAGE_VERSION='1.5.0'\nPACKAGE_STRING='pgreplay 1.5.0'\nPACKAGE_BUGREPORT='https://github.com/laurenz/pgreplay/issues'\nPACKAGE_URL='http://laurenz.github.io/pgreplay/'\n\nac_unique_file=\"parse.c\"\n# Factoring default headers for most tests.\nac_includes_default=\"\\\n#include <stddef.h>\n#ifdef HAVE_STDIO_H\n# include <stdio.h>\n#endif\n#ifdef HAVE_STDLIB_H\n# include <stdlib.h>\n#endif\n#ifdef HAVE_STRING_H\n# include <string.h>\n#endif\n#ifdef HAVE_INTTYPES_H\n# include <inttypes.h>\n#endif\n#ifdef HAVE_STDINT_H\n# include <stdint.h>\n#endif\n#ifdef HAVE_STRINGS_H\n# include <strings.h>\n#endif\n#ifdef HAVE_SYS_TYPES_H\n# include <sys/types.h>\n#endif\n#ifdef HAVE_SYS_STAT_H\n# include <sys/stat.h>\n#endif\n#ifdef HAVE_UNISTD_H\n# include <unistd.h>\n#endif\"\n\nac_header_c_list=\nenable_year2038=no\nac_subst_vars='LTLIBOBJS\nLIBOBJS\nPOW_LIB\nEXTRA_OBJS\nac_prefix_program\npgbindir\nOBJEXT\nEXEEXT\nac_ct_CC\nCPPFLAGS\nLDFLAGS\nCFLAGS\nCC\nINSTALL_DATA\nINSTALL_SCRIPT\nINSTALL_PROGRAM\nbuild_os\nbuild_vendor\nbuild_cpu\nbuild\ntarget_alias\nhost_alias\nbuild_alias\nLIBS\nECHO_T\nECHO_N\nECHO_C\nDEFS\nmandir\nlocaledir\nlibdir\npsdir\npdfdir\ndvidir\nhtmldir\ninfodir\ndocdir\noldincludedir\nincludedir\nrunstatedir\nlocalstatedir\nsharedstatedir\nsysconfdir\ndatadir\ndatarootdir\nlibexecdir\nsbindir\nbindir\nprogram_transform_name\nprefix\nexec_prefix\nPACKAGE_URL\nPACKAGE_BUGREPORT\nPACKAGE_STRING\nPACKAGE_VERSION\nPACKAGE_TARNAME\nPACKAGE_NAME\nPATH_SEPARATOR\nSHELL'\nac_subst_files=''\nac_user_opts='\nenable_option_checking\nwith_postgres\nenable_largefile\nenable_year2038\n'\n      ac_precious_vars='build_alias\nhost_alias\ntarget_alias\nCC\nCFLAGS\nLDFLAGS\nLIBS\nCPPFLAGS'\n\n\n# Initialize some variables set by options.\nac_init_help=\nac_init_version=false\nac_unrecognized_opts=\nac_unrecognized_sep=\n# The variables have the same names as the options, with\n# dashes changed to underlines.\ncache_file=/dev/null\nexec_prefix=NONE\nno_create=\nno_recursion=\nprefix=NONE\nprogram_prefix=NONE\nprogram_suffix=NONE\nprogram_transform_name=s,x,x,\nsilent=\nsite=\nsrcdir=\nverbose=\nx_includes=NONE\nx_libraries=NONE\n\n# Installation directory options.\n# These are left unexpanded so users can \"make install exec_prefix=/foo\"\n# and all the variables that are supposed to be based on exec_prefix\n# by default will actually change.\n# Use braces instead of parens because sh, perl, etc. also accept them.\n# (The list follows the same order as the GNU Coding Standards.)\nbindir='${exec_prefix}/bin'\nsbindir='${exec_prefix}/sbin'\nlibexecdir='${exec_prefix}/libexec'\ndatarootdir='${prefix}/share'\ndatadir='${datarootdir}'\nsysconfdir='${prefix}/etc'\nsharedstatedir='${prefix}/com'\nlocalstatedir='${prefix}/var'\nrunstatedir='${localstatedir}/run'\nincludedir='${prefix}/include'\noldincludedir='/usr/include'\ndocdir='${datarootdir}/doc/${PACKAGE_TARNAME}'\ninfodir='${datarootdir}/info'\nhtmldir='${docdir}'\ndvidir='${docdir}'\npdfdir='${docdir}'\npsdir='${docdir}'\nlibdir='${exec_prefix}/lib'\nlocaledir='${datarootdir}/locale'\nmandir='${datarootdir}/man'\n\nac_prev=\nac_dashdash=\nfor ac_option\ndo\n  # If the previous option needs an argument, assign it.\n  if test -n \"$ac_prev\"; then\n    eval $ac_prev=\\$ac_option\n    ac_prev=\n    continue\n  fi\n\n  case $ac_option in\n  *=?*) ac_optarg=`expr \"X$ac_option\" : '[^=]*=\\(.*\\)'` ;;\n  *=)   ac_optarg= ;;\n  *)    ac_optarg=yes ;;\n  esac\n\n  case $ac_dashdash$ac_option in\n  --)\n    ac_dashdash=yes ;;\n\n  -bindir | --bindir | --bindi | --bind | --bin | --bi)\n    ac_prev=bindir ;;\n  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)\n    bindir=$ac_optarg ;;\n\n  -build | --build | --buil | --bui | --bu)\n    ac_prev=build_alias ;;\n  -build=* | --build=* | --buil=* | --bui=* | --bu=*)\n    build_alias=$ac_optarg ;;\n\n  -cache-file | --cache-file | --cache-fil | --cache-fi \\\n  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)\n    ac_prev=cache_file ;;\n  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \\\n  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)\n    cache_file=$ac_optarg ;;\n\n  --config-cache | -C)\n    cache_file=config.cache ;;\n\n  -datadir | --datadir | --datadi | --datad)\n    ac_prev=datadir ;;\n  -datadir=* | --datadir=* | --datadi=* | --datad=*)\n    datadir=$ac_optarg ;;\n\n  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \\\n  | --dataroo | --dataro | --datar)\n    ac_prev=datarootdir ;;\n  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \\\n  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)\n    datarootdir=$ac_optarg ;;\n\n  -disable-* | --disable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*disable-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: '$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=no ;;\n\n  -docdir | --docdir | --docdi | --doc | --do)\n    ac_prev=docdir ;;\n  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)\n    docdir=$ac_optarg ;;\n\n  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)\n    ac_prev=dvidir ;;\n  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)\n    dvidir=$ac_optarg ;;\n\n  -enable-* | --enable-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*enable-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid feature name: '$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"enable_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval enable_$ac_useropt=\\$ac_optarg ;;\n\n  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \\\n  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \\\n  | --exec | --exe | --ex)\n    ac_prev=exec_prefix ;;\n  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \\\n  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \\\n  | --exec=* | --exe=* | --ex=*)\n    exec_prefix=$ac_optarg ;;\n\n  -gas | --gas | --ga | --g)\n    # Obsolete; use --with-gas.\n    with_gas=yes ;;\n\n  -help | --help | --hel | --he | -h)\n    ac_init_help=long ;;\n  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)\n    ac_init_help=recursive ;;\n  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)\n    ac_init_help=short ;;\n\n  -host | --host | --hos | --ho)\n    ac_prev=host_alias ;;\n  -host=* | --host=* | --hos=* | --ho=*)\n    host_alias=$ac_optarg ;;\n\n  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)\n    ac_prev=htmldir ;;\n  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \\\n  | --ht=*)\n    htmldir=$ac_optarg ;;\n\n  -includedir | --includedir | --includedi | --included | --include \\\n  | --includ | --inclu | --incl | --inc)\n    ac_prev=includedir ;;\n  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \\\n  | --includ=* | --inclu=* | --incl=* | --inc=*)\n    includedir=$ac_optarg ;;\n\n  -infodir | --infodir | --infodi | --infod | --info | --inf)\n    ac_prev=infodir ;;\n  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)\n    infodir=$ac_optarg ;;\n\n  -libdir | --libdir | --libdi | --libd)\n    ac_prev=libdir ;;\n  -libdir=* | --libdir=* | --libdi=* | --libd=*)\n    libdir=$ac_optarg ;;\n\n  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \\\n  | --libexe | --libex | --libe)\n    ac_prev=libexecdir ;;\n  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \\\n  | --libexe=* | --libex=* | --libe=*)\n    libexecdir=$ac_optarg ;;\n\n  -localedir | --localedir | --localedi | --localed | --locale)\n    ac_prev=localedir ;;\n  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)\n    localedir=$ac_optarg ;;\n\n  -localstatedir | --localstatedir | --localstatedi | --localstated \\\n  | --localstate | --localstat | --localsta | --localst | --locals)\n    ac_prev=localstatedir ;;\n  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \\\n  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)\n    localstatedir=$ac_optarg ;;\n\n  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)\n    ac_prev=mandir ;;\n  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)\n    mandir=$ac_optarg ;;\n\n  -nfp | --nfp | --nf)\n    # Obsolete; use --without-fp.\n    with_fp=no ;;\n\n  -no-create | --no-create | --no-creat | --no-crea | --no-cre \\\n  | --no-cr | --no-c | -n)\n    no_create=yes ;;\n\n  -no-recursion | --no-recursion | --no-recursio | --no-recursi \\\n  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)\n    no_recursion=yes ;;\n\n  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \\\n  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \\\n  | --oldin | --oldi | --old | --ol | --o)\n    ac_prev=oldincludedir ;;\n  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \\\n  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \\\n  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)\n    oldincludedir=$ac_optarg ;;\n\n  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)\n    ac_prev=prefix ;;\n  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)\n    prefix=$ac_optarg ;;\n\n  -program-prefix | --program-prefix | --program-prefi | --program-pref \\\n  | --program-pre | --program-pr | --program-p)\n    ac_prev=program_prefix ;;\n  -program-prefix=* | --program-prefix=* | --program-prefi=* \\\n  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)\n    program_prefix=$ac_optarg ;;\n\n  -program-suffix | --program-suffix | --program-suffi | --program-suff \\\n  | --program-suf | --program-su | --program-s)\n    ac_prev=program_suffix ;;\n  -program-suffix=* | --program-suffix=* | --program-suffi=* \\\n  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)\n    program_suffix=$ac_optarg ;;\n\n  -program-transform-name | --program-transform-name \\\n  | --program-transform-nam | --program-transform-na \\\n  | --program-transform-n | --program-transform- \\\n  | --program-transform | --program-transfor \\\n  | --program-transfo | --program-transf \\\n  | --program-trans | --program-tran \\\n  | --progr-tra | --program-tr | --program-t)\n    ac_prev=program_transform_name ;;\n  -program-transform-name=* | --program-transform-name=* \\\n  | --program-transform-nam=* | --program-transform-na=* \\\n  | --program-transform-n=* | --program-transform-=* \\\n  | --program-transform=* | --program-transfor=* \\\n  | --program-transfo=* | --program-transf=* \\\n  | --program-trans=* | --program-tran=* \\\n  | --progr-tra=* | --program-tr=* | --program-t=*)\n    program_transform_name=$ac_optarg ;;\n\n  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)\n    ac_prev=pdfdir ;;\n  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)\n    pdfdir=$ac_optarg ;;\n\n  -psdir | --psdir | --psdi | --psd | --ps)\n    ac_prev=psdir ;;\n  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)\n    psdir=$ac_optarg ;;\n\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil)\n    silent=yes ;;\n\n  -runstatedir | --runstatedir | --runstatedi | --runstated \\\n  | --runstate | --runstat | --runsta | --runst | --runs \\\n  | --run | --ru | --r)\n    ac_prev=runstatedir ;;\n  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \\\n  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \\\n  | --run=* | --ru=* | --r=*)\n    runstatedir=$ac_optarg ;;\n\n  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)\n    ac_prev=sbindir ;;\n  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \\\n  | --sbi=* | --sb=*)\n    sbindir=$ac_optarg ;;\n\n  -sharedstatedir | --sharedstatedir | --sharedstatedi \\\n  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \\\n  | --sharedst | --shareds | --shared | --share | --shar \\\n  | --sha | --sh)\n    ac_prev=sharedstatedir ;;\n  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \\\n  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \\\n  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \\\n  | --sha=* | --sh=*)\n    sharedstatedir=$ac_optarg ;;\n\n  -site | --site | --sit)\n    ac_prev=site ;;\n  -site=* | --site=* | --sit=*)\n    site=$ac_optarg ;;\n\n  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)\n    ac_prev=srcdir ;;\n  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)\n    srcdir=$ac_optarg ;;\n\n  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \\\n  | --syscon | --sysco | --sysc | --sys | --sy)\n    ac_prev=sysconfdir ;;\n  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \\\n  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)\n    sysconfdir=$ac_optarg ;;\n\n  -target | --target | --targe | --targ | --tar | --ta | --t)\n    ac_prev=target_alias ;;\n  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)\n    target_alias=$ac_optarg ;;\n\n  -v | -verbose | --verbose | --verbos | --verbo | --verb)\n    verbose=yes ;;\n\n  -version | --version | --versio | --versi | --vers | -V)\n    ac_init_version=: ;;\n\n  -with-* | --with-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*with-\\([^=]*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: '$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=\\$ac_optarg ;;\n\n  -without-* | --without-*)\n    ac_useropt=`expr \"x$ac_option\" : 'x-*without-\\(.*\\)'`\n    # Reject names that are not valid shell variable names.\n    expr \"x$ac_useropt\" : \".*[^-+._$as_cr_alnum]\" >/dev/null &&\n      as_fn_error $? \"invalid package name: '$ac_useropt'\"\n    ac_useropt_orig=$ac_useropt\n    ac_useropt=`printf \"%s\\n\" \"$ac_useropt\" | sed 's/[-+.]/_/g'`\n    case $ac_user_opts in\n      *\"\n\"with_$ac_useropt\"\n\"*) ;;\n      *) ac_unrecognized_opts=\"$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig\"\n\t ac_unrecognized_sep=', ';;\n    esac\n    eval with_$ac_useropt=no ;;\n\n  --x)\n    # Obsolete; use --with-x.\n    with_x=yes ;;\n\n  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \\\n  | --x-incl | --x-inc | --x-in | --x-i)\n    ac_prev=x_includes ;;\n  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \\\n  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)\n    x_includes=$ac_optarg ;;\n\n  -x-libraries | --x-libraries | --x-librarie | --x-librari \\\n  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)\n    ac_prev=x_libraries ;;\n  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \\\n  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)\n    x_libraries=$ac_optarg ;;\n\n  -*) as_fn_error $? \"unrecognized option: '$ac_option'\nTry '$0 --help' for more information\"\n    ;;\n\n  *=*)\n    ac_envvar=`expr \"x$ac_option\" : 'x\\([^=]*\\)='`\n    # Reject names that are not valid shell variable names.\n    case $ac_envvar in #(\n      '' | [0-9]* | *[!_$as_cr_alnum]* )\n      as_fn_error $? \"invalid variable name: '$ac_envvar'\" ;;\n    esac\n    eval $ac_envvar=\\$ac_optarg\n    export $ac_envvar ;;\n\n  *)\n    # FIXME: should be removed in autoconf 3.0.\n    printf \"%s\\n\" \"$as_me: WARNING: you should use --build, --host, --target\" >&2\n    expr \"x$ac_option\" : \".*[^-._$as_cr_alnum]\" >/dev/null &&\n      printf \"%s\\n\" \"$as_me: WARNING: invalid host type: $ac_option\" >&2\n    : \"${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}\"\n    ;;\n\n  esac\ndone\n\nif test -n \"$ac_prev\"; then\n  ac_option=--`echo $ac_prev | sed 's/_/-/g'`\n  as_fn_error $? \"missing argument to $ac_option\"\nfi\n\nif test -n \"$ac_unrecognized_opts\"; then\n  case $enable_option_checking in\n    no) ;;\n    fatal) as_fn_error $? \"unrecognized options: $ac_unrecognized_opts\" ;;\n    *)     printf \"%s\\n\" \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2 ;;\n  esac\nfi\n\n# Check all directory arguments for consistency.\nfor ac_var in\texec_prefix prefix bindir sbindir libexecdir datarootdir \\\n\t\tdatadir sysconfdir sharedstatedir localstatedir includedir \\\n\t\toldincludedir docdir infodir htmldir dvidir pdfdir psdir \\\n\t\tlibdir localedir mandir runstatedir\ndo\n  eval ac_val=\\$$ac_var\n  # Remove trailing slashes.\n  case $ac_val in\n    */ )\n      ac_val=`expr \"X$ac_val\" : 'X\\(.*[^/]\\)' \\| \"X$ac_val\" : 'X\\(.*\\)'`\n      eval $ac_var=\\$ac_val;;\n  esac\n  # Be sure to have absolute directory names.\n  case $ac_val in\n    [\\\\/$]* | ?:[\\\\/]* )  continue;;\n    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;\n  esac\n  as_fn_error $? \"expected an absolute directory name for --$ac_var: $ac_val\"\ndone\n\n# There might be people who depend on the old broken behavior: '$host'\n# used to hold the argument of --host etc.\n# FIXME: To remove some day.\nbuild=$build_alias\nhost=$host_alias\ntarget=$target_alias\n\n# FIXME: To remove some day.\nif test \"x$host_alias\" != x; then\n  if test \"x$build_alias\" = x; then\n    cross_compiling=maybe\n  elif test \"x$build_alias\" != \"x$host_alias\"; then\n    cross_compiling=yes\n  fi\nfi\n\nac_tool_prefix=\ntest -n \"$host_alias\" && ac_tool_prefix=$host_alias-\n\ntest \"$silent\" = yes && exec 6>/dev/null\n\n\nac_pwd=`pwd` && test -n \"$ac_pwd\" &&\nac_ls_di=`ls -di .` &&\nac_pwd_ls_di=`cd \"$ac_pwd\" && ls -di .` ||\n  as_fn_error $? \"working directory cannot be determined\"\ntest \"X$ac_ls_di\" = \"X$ac_pwd_ls_di\" ||\n  as_fn_error $? \"pwd does not report name of working directory\"\n\n\n# Find the source files, if location was not specified.\nif test -z \"$srcdir\"; then\n  ac_srcdir_defaulted=yes\n  # Try the directory containing this script, then the parent directory.\n  ac_confdir=`$as_dirname -- \"$as_myself\" ||\n$as_expr X\"$as_myself\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_myself\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_myself\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$as_myself\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  srcdir=$ac_confdir\n  if test ! -r \"$srcdir/$ac_unique_file\"; then\n    srcdir=..\n  fi\nelse\n  ac_srcdir_defaulted=no\nfi\nif test ! -r \"$srcdir/$ac_unique_file\"; then\n  test \"$ac_srcdir_defaulted\" = yes && srcdir=\"$ac_confdir or ..\"\n  as_fn_error $? \"cannot find sources ($ac_unique_file) in $srcdir\"\nfi\nac_msg=\"sources are in $srcdir, but 'cd $srcdir' does not work\"\nac_abs_confdir=`(\n\tcd \"$srcdir\" && test -r \"./$ac_unique_file\" || as_fn_error $? \"$ac_msg\"\n\tpwd)`\n# When building in place, set srcdir=.\nif test \"$ac_abs_confdir\" = \"$ac_pwd\"; then\n  srcdir=.\nfi\n# Remove unnecessary trailing slashes from srcdir.\n# Double slashes in file names in object file debugging info\n# mess up M-x gdb in Emacs.\ncase $srcdir in\n*/) srcdir=`expr \"X$srcdir\" : 'X\\(.*[^/]\\)' \\| \"X$srcdir\" : 'X\\(.*\\)'`;;\nesac\nfor ac_var in $ac_precious_vars; do\n  eval ac_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_env_${ac_var}_value=\\$${ac_var}\n  eval ac_cv_env_${ac_var}_set=\\${${ac_var}+set}\n  eval ac_cv_env_${ac_var}_value=\\$${ac_var}\ndone\n\n#\n# Report the --help message.\n#\nif test \"$ac_init_help\" = \"long\"; then\n  # Omit some internal or obsolete options to make the list less imposing.\n  # This message is too long to be a string in the A/UX 3.1 sh.\n  cat <<_ACEOF\n'configure' configures pgreplay 1.5.0 to adapt to many kinds of systems.\n\nUsage: $0 [OPTION]... [VAR=VALUE]...\n\nTo assign environment variables (e.g., CC, CFLAGS...), specify them as\nVAR=VALUE.  See below for descriptions of some of the useful variables.\n\nDefaults for the options are specified in brackets.\n\nConfiguration:\n  -h, --help              display this help and exit\n      --help=short        display options specific to this package\n      --help=recursive    display the short help of all the included packages\n  -V, --version           display version information and exit\n  -q, --quiet, --silent   do not print 'checking ...' messages\n      --cache-file=FILE   cache test results in FILE [disabled]\n  -C, --config-cache      alias for '--cache-file=config.cache'\n  -n, --no-create         do not create output files\n      --srcdir=DIR        find the sources in DIR [configure dir or '..']\n\nInstallation directories:\n  --prefix=PREFIX         install architecture-independent files in PREFIX\n                          [$ac_default_prefix]\n  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX\n                          [PREFIX]\n\nBy default, 'make install' will install all the files in\n'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc.  You can specify\nan installation prefix other than '$ac_default_prefix' using '--prefix',\nfor instance '--prefix=\\$HOME'.\n\nFor better control, use the options below.\n\nFine tuning of the installation directories:\n  --bindir=DIR            user executables [EPREFIX/bin]\n  --sbindir=DIR           system admin executables [EPREFIX/sbin]\n  --libexecdir=DIR        program executables [EPREFIX/libexec]\n  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]\n  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]\n  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]\n  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]\n  --libdir=DIR            object code libraries [EPREFIX/lib]\n  --includedir=DIR        C header files [PREFIX/include]\n  --oldincludedir=DIR     C header files for non-gcc [/usr/include]\n  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]\n  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]\n  --infodir=DIR           info documentation [DATAROOTDIR/info]\n  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]\n  --mandir=DIR            man documentation [DATAROOTDIR/man]\n  --docdir=DIR            documentation root [DATAROOTDIR/doc/pgreplay]\n  --htmldir=DIR           html documentation [DOCDIR]\n  --dvidir=DIR            dvi documentation [DOCDIR]\n  --pdfdir=DIR            pdf documentation [DOCDIR]\n  --psdir=DIR             ps documentation [DOCDIR]\n_ACEOF\n\n  cat <<\\_ACEOF\n\nSystem types:\n  --build=BUILD     configure for building on BUILD [guessed]\n_ACEOF\nfi\n\nif test -n \"$ac_init_help\"; then\n  case $ac_init_help in\n     short | recursive ) echo \"Configuration of pgreplay 1.5.0:\";;\n   esac\n  cat <<\\_ACEOF\n\nOptional Features:\n  --disable-option-checking  ignore unrecognized --enable/--with options\n  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)\n  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]\n  --disable-largefile     omit support for large files\n  --enable-year2038       support timestamps after 2038\n\nOptional Packages:\n  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]\n  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)\n  --with-postgres=DIR     specify location of pg_config for your PostgreSQL\n                          installation\n\nSome influential environment variables:\n  CC          C compiler command\n  CFLAGS      C compiler flags\n  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a\n              nonstandard directory <lib dir>\n  LIBS        libraries to pass to the linker, e.g. -l<library>\n  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if\n              you have headers in a nonstandard directory <include dir>\n\nUse these variables to override the choices made by 'configure' or to help\nit to find libraries and programs with nonstandard names/locations.\n\nReport bugs to <https://github.com/laurenz/pgreplay/issues>.\npgreplay home page: <http://laurenz.github.io/pgreplay/>.\n_ACEOF\nac_status=$?\nfi\n\nif test \"$ac_init_help\" = \"recursive\"; then\n  # If there are subdirs, report their specific --help.\n  for ac_dir in : $ac_subdirs_all; do test \"x$ac_dir\" = x: && continue\n    test -d \"$ac_dir\" ||\n      { cd \"$srcdir\" && ac_pwd=`pwd` && srcdir=. && test -d \"$ac_dir\"; } ||\n      continue\n    ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`printf \"%s\\n\" \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`printf \"%s\\n\" \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n    cd \"$ac_dir\" || { ac_status=$?; continue; }\n    # Check for configure.gnu first; this name is used for a wrapper for\n    # Metaconfig's \"Configure\" on case-insensitive file systems.\n    if test -f \"$ac_srcdir/configure.gnu\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure.gnu\" --help=recursive\n    elif test -f \"$ac_srcdir/configure\"; then\n      echo &&\n      $SHELL \"$ac_srcdir/configure\" --help=recursive\n    else\n      printf \"%s\\n\" \"$as_me: WARNING: no configuration information is in $ac_dir\" >&2\n    fi || ac_status=$?\n    cd \"$ac_pwd\" || { ac_status=$?; break; }\n  done\nfi\n\ntest -n \"$ac_init_help\" && exit $ac_status\nif $ac_init_version; then\n  cat <<\\_ACEOF\npgreplay configure 1.5.0\ngenerated by GNU Autoconf 2.72\n\nCopyright (C) 2023 Free Software Foundation, Inc.\nThis configure script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\n_ACEOF\n  exit\nfi\n\n## ------------------------ ##\n## Autoconf initialization. ##\n## ------------------------ ##\n\n# ac_fn_c_try_compile LINENO\n# --------------------------\n# Try to compile conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_compile ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  rm -f conftest.$ac_objext conftest.beam\n  if { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && {\n\t test -z \"$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       } && test -s conftest.$ac_objext\nthen :\n  ac_retval=0\nelse case e in #(\n  e) printf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n\tac_retval=1 ;;\nesac\nfi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_compile\n\n# ac_fn_c_try_link LINENO\n# -----------------------\n# Try to link conftest.$ac_ext, and return whether this succeeded.\nac_fn_c_try_link ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext\n  if { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    grep -v '^ *+' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n    mv -f conftest.er1 conftest.err\n  fi\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && {\n\t test -z \"$ac_c_werror_flag\" ||\n\t test ! -s conftest.err\n       } && test -s conftest$ac_exeext && {\n\t test \"$cross_compiling\" = yes ||\n\t test -x conftest$ac_exeext\n       }\nthen :\n  ac_retval=0\nelse case e in #(\n  e) printf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n\tac_retval=1 ;;\nesac\nfi\n  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information\n  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would\n  # interfere with the next link command; also delete a directory that is\n  # left behind by Apple's compiler.  We do this before executing the actions.\n  rm -rf conftest.dSYM conftest_ipa8_conftest.oo\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_link\n\n# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES\n# -------------------------------------------------------\n# Tests whether HEADER exists and can be compiled using the include files in\n# INCLUDES, setting the cache variable VAR accordingly.\nac_fn_c_check_header_compile ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\nprintf %s \"checking for $2... \" >&6; }\nif eval test \\${$3+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\n#include <$2>\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  eval \"$3=yes\"\nelse case e in #(\n  e) eval \"$3=no\" ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;\nesac\nfi\neval ac_res=\\$$3\n\t       { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\nprintf \"%s\\n\" \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_header_compile\n\n# ac_fn_c_check_type LINENO TYPE VAR INCLUDES\n# -------------------------------------------\n# Tests whether TYPE exists after having included INCLUDES, setting cache\n# variable VAR accordingly.\nac_fn_c_check_type ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\nprintf %s \"checking for $2... \" >&6; }\nif eval test \\${$3+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) eval \"$3=no\"\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain (void)\n{\nif (sizeof ($2))\n\t return 0;\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain (void)\n{\nif (sizeof (($2)))\n\t    return 0;\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n\nelse case e in #(\n  e) eval \"$3=yes\" ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;\nesac\nfi\neval ac_res=\\$$3\n\t       { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\nprintf \"%s\\n\" \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_type\n\n# ac_fn_c_find_uintX_t LINENO BITS VAR\n# ------------------------------------\n# Finds an unsigned integer type with width BITS, setting cache variable VAR\n# accordingly.\nac_fn_c_find_uintX_t ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for uint$2_t\" >&5\nprintf %s \"checking for uint$2_t... \" >&6; }\nif eval test \\${$3+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) eval \"$3=no\"\n     # Order is important - never check a type that is potentially smaller\n     # than half of the expected target width.\n     for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \\\n\t 'unsigned long long int' 'unsigned short int' 'unsigned char'; do\n       cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain (void)\n{\nstatic int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  case $ac_type in #(\n  uint$2_t) :\n    eval \"$3=yes\" ;; #(\n  *) :\n    eval \"$3=\\$ac_type\" ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n       if eval test \\\"x\\$\"$3\"\\\" = x\"no\"\nthen :\n\nelse case e in #(\n  e) break ;;\nesac\nfi\n     done ;;\nesac\nfi\neval ac_res=\\$$3\n\t       { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\nprintf \"%s\\n\" \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_find_uintX_t\n\n# ac_fn_c_try_run LINENO\n# ----------------------\n# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that\n# executables *can* be run.\nac_fn_c_try_run ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'\n  { { case \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_try\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; }\nthen :\n  ac_retval=0\nelse case e in #(\n  e) printf \"%s\\n\" \"$as_me: program exited with status $ac_status\" >&5\n       printf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n       ac_retval=$ac_status ;;\nesac\nfi\n  rm -rf conftest.dSYM conftest_ipa8_conftest.oo\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_try_run\n\n# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES\n# --------------------------------------------\n# Tries to find the compile-time value of EXPR in a program that includes\n# INCLUDES, setting VAR accordingly. Returns whether the value could be\n# computed\nac_fn_c_compute_int ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  if test \"$cross_compiling\" = yes; then\n    # Depending upon the size, compute the lo and hi bounds.\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain (void)\n{\nstatic int test_array [1 - 2 * !(($2) >= 0)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_lo=0 ac_mid=0\n  while :; do\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain (void)\n{\nstatic int test_array [1 - 2 * !(($2) <= $ac_mid)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_hi=$ac_mid; break\nelse case e in #(\n  e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val\n\t\t\tif test $ac_lo -le $ac_mid; then\n\t\t\t  ac_lo= ac_hi=\n\t\t\t  break\n\t\t\tfi\n\t\t\tas_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n  done\nelse case e in #(\n  e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain (void)\n{\nstatic int test_array [1 - 2 * !(($2) < 0)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_hi=-1 ac_mid=-1\n  while :; do\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain (void)\n{\nstatic int test_array [1 - 2 * !(($2) >= $ac_mid)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_lo=$ac_mid; break\nelse case e in #(\n  e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val\n\t\t\tif test $ac_mid -le $ac_hi; then\n\t\t\t  ac_lo= ac_hi=\n\t\t\t  break\n\t\t\tfi\n\t\t\tas_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n  done\nelse case e in #(\n  e) ac_lo= ac_hi= ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n# Binary search between lo and hi bounds.\nwhile test \"x$ac_lo\" != \"x$ac_hi\"; do\n  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val\n  cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nint\nmain (void)\n{\nstatic int test_array [1 - 2 * !(($2) <= $ac_mid)];\ntest_array [0] = 0;\nreturn test_array [0];\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_hi=$ac_mid\nelse case e in #(\n  e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\ndone\ncase $ac_lo in #((\n?*) eval \"$3=\\$ac_lo\"; ac_retval=0 ;;\n'') ac_retval=1 ;;\nesac\n  else\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$4\nstatic long int longval (void) { return $2; }\nstatic unsigned long int ulongval (void) { return $2; }\n#include <stdio.h>\n#include <stdlib.h>\nint\nmain (void)\n{\n\n  FILE *f = fopen (\"conftest.val\", \"w\");\n  if (! f)\n    return 1;\n  if (($2) < 0)\n    {\n      long int i = longval ();\n      if (i != ($2))\n\treturn 1;\n      fprintf (f, \"%ld\", i);\n    }\n  else\n    {\n      unsigned long int i = ulongval ();\n      if (i != ($2))\n\treturn 1;\n      fprintf (f, \"%lu\", i);\n    }\n  /* Do not output a trailing newline, as this causes \\r\\n confusion\n     on some platforms.  */\n  return ferror (f) || fclose (f) != 0;\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"\nthen :\n  echo >>conftest.val; read $3 <conftest.val; ac_retval=0\nelse case e in #(\n  e) ac_retval=1 ;;\nesac\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext\nrm -f conftest.val\n\n  fi\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n  as_fn_set_status $ac_retval\n\n} # ac_fn_c_compute_int\n\n# ac_fn_c_check_func LINENO FUNC VAR\n# ----------------------------------\n# Tests whether FUNC exists, setting the cache variable VAR accordingly\nac_fn_c_check_func ()\n{\n  as_lineno=${as_lineno-\"$1\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $2\" >&5\nprintf %s \"checking for $2... \" >&6; }\nif eval test \\${$3+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n/* Define $2 to an innocuous variant, in case <limits.h> declares $2.\n   For example, HP-UX 11i <limits.h> declares gettimeofday.  */\n#define $2 innocuous_$2\n\n/* System header to define __stub macros and hopefully few prototypes,\n   which can conflict with char $2 (void); below.  */\n\n#include <limits.h>\n#undef $2\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar $2 (void);\n/* The GNU C library defines this for functions which it implements\n    to always fail with ENOSYS.  Some functions are actually named\n    something starting with __ and the normal name is an alias.  */\n#if defined __stub_$2 || defined __stub___$2\nchoke me\n#endif\n\nint\nmain (void)\n{\nreturn $2 ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"\nthen :\n  eval \"$3=yes\"\nelse case e in #(\n  e) eval \"$3=no\" ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam \\\n    conftest$ac_exeext conftest.$ac_ext ;;\nesac\nfi\neval ac_res=\\$$3\n\t       { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_res\" >&5\nprintf \"%s\\n\" \"$ac_res\" >&6; }\n  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno\n\n} # ac_fn_c_check_func\nac_configure_args_raw=\nfor ac_arg\ndo\n  case $ac_arg in\n  *\\'*)\n    ac_arg=`printf \"%s\\n\" \"$ac_arg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n  esac\n  as_fn_append ac_configure_args_raw \" '$ac_arg'\"\ndone\n\ncase $ac_configure_args_raw in\n  *$as_nl*)\n    ac_safe_unquote= ;;\n  *)\n    ac_unsafe_z='|&;<>()$`\\\\\"*?[ ''\t' # This string ends in space, tab.\n    ac_unsafe_a=\"$ac_unsafe_z#~\"\n    ac_safe_unquote=\"s/ '\\\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\\\)'/ \\\\1/g\"\n    ac_configure_args_raw=`      printf \"%s\\n\" \"$ac_configure_args_raw\" | sed \"$ac_safe_unquote\"`;;\nesac\n\ncat >config.log <<_ACEOF\nThis file contains any messages produced by compilers while\nrunning configure, to aid debugging if configure makes a mistake.\n\nIt was created by pgreplay $as_me 1.5.0, which was\ngenerated by GNU Autoconf 2.72.  Invocation command line was\n\n  $ $0$ac_configure_args_raw\n\n_ACEOF\nexec 5>>config.log\n{\ncat <<_ASUNAME\n## --------- ##\n## Platform. ##\n## --------- ##\n\nhostname = `(hostname || uname -n) 2>/dev/null | sed 1q`\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`\n\n/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`\n/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`\n/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`\n/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`\n\n_ASUNAME\n\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    printf \"%s\\n\" \"PATH: $as_dir\"\n  done\nIFS=$as_save_IFS\n\n} >&5\n\ncat >&5 <<_ACEOF\n\n\n## ----------- ##\n## Core tests. ##\n## ----------- ##\n\n_ACEOF\n\n\n# Keep a trace of the command line.\n# Strip out --no-create and --no-recursion so they do not pile up.\n# Strip out --silent because we don't want to record it for future runs.\n# Also quote any args containing shell meta-characters.\n# Make two passes to allow for proper duplicate-argument suppression.\nac_configure_args=\nac_configure_args0=\nac_configure_args1=\nac_must_keep_next=false\nfor ac_pass in 1 2\ndo\n  for ac_arg\n  do\n    case $ac_arg in\n    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;\n    -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n    | -silent | --silent | --silen | --sile | --sil)\n      continue ;;\n    *\\'*)\n      ac_arg=`printf \"%s\\n\" \"$ac_arg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    case $ac_pass in\n    1) as_fn_append ac_configure_args0 \" '$ac_arg'\" ;;\n    2)\n      as_fn_append ac_configure_args1 \" '$ac_arg'\"\n      if test $ac_must_keep_next = true; then\n\tac_must_keep_next=false # Got value, back to normal.\n      else\n\tcase $ac_arg in\n\t  *=* | --config-cache | -C | -disable-* | --disable-* \\\n\t  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \\\n\t  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \\\n\t  | -with-* | --with-* | -without-* | --without-* | --x)\n\t    case \"$ac_configure_args0 \" in\n\t      \"$ac_configure_args1\"*\" '$ac_arg' \"* ) continue ;;\n\t    esac\n\t    ;;\n\t  -* ) ac_must_keep_next=true ;;\n\tesac\n      fi\n      as_fn_append ac_configure_args \" '$ac_arg'\"\n      ;;\n    esac\n  done\ndone\n{ ac_configure_args0=; unset ac_configure_args0;}\n{ ac_configure_args1=; unset ac_configure_args1;}\n\n# When interrupted or exit'd, cleanup temporary files, and complete\n# config.log.  We remove comments because anyway the quotes in there\n# would cause problems or look ugly.\n# WARNING: Use '\\'' to represent an apostrophe within the trap.\n# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.\ntrap 'exit_status=$?\n  # Sanitize IFS.\n  IFS=\" \"\"\t$as_nl\"\n  # Save into config.log some information that might help in debugging.\n  {\n    echo\n\n    printf \"%s\\n\" \"## ---------------- ##\n## Cache variables. ##\n## ---------------- ##\"\n    echo\n    # The following way of writing the cache mishandles newlines in values,\n(\n  for ac_var in `(set) 2>&1 | sed -n '\\''s/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'\\''`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n  (set) 2>&1 |\n    case $as_nl`(ac_space='\\'' '\\''; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      sed -n \\\n\t\"s/'\\''/'\\''\\\\\\\\'\\'''\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\''\\\\2'\\''/p\"\n      ;; #(\n    *)\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n)\n    echo\n\n    printf \"%s\\n\" \"## ----------------- ##\n## Output variables. ##\n## ----------------- ##\"\n    echo\n    for ac_var in $ac_subst_vars\n    do\n      eval ac_val=\\$$ac_var\n      case $ac_val in\n      *\\'\\''*) ac_val=`printf \"%s\\n\" \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n      esac\n      printf \"%s\\n\" \"$ac_var='\\''$ac_val'\\''\"\n    done | sort\n    echo\n\n    if test -n \"$ac_subst_files\"; then\n      printf \"%s\\n\" \"## ------------------- ##\n## File substitutions. ##\n## ------------------- ##\"\n      echo\n      for ac_var in $ac_subst_files\n      do\n\teval ac_val=\\$$ac_var\n\tcase $ac_val in\n\t*\\'\\''*) ac_val=`printf \"%s\\n\" \"$ac_val\" | sed \"s/'\\''/'\\''\\\\\\\\\\\\\\\\'\\'''\\''/g\"`;;\n\tesac\n\tprintf \"%s\\n\" \"$ac_var='\\''$ac_val'\\''\"\n      done | sort\n      echo\n    fi\n\n    if test -s confdefs.h; then\n      printf \"%s\\n\" \"## ----------- ##\n## confdefs.h. ##\n## ----------- ##\"\n      echo\n      cat confdefs.h\n      echo\n    fi\n    test \"$ac_signal\" != 0 &&\n      printf \"%s\\n\" \"$as_me: caught signal $ac_signal\"\n    printf \"%s\\n\" \"$as_me: exit $exit_status\"\n  } >&5\n  rm -f core *.core core.conftest.* &&\n    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&\n    exit $exit_status\n' 0\nfor ac_signal in 1 2 13 15; do\n  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal\ndone\nac_signal=0\n\n# confdefs.h avoids OS command line length limits that DEFS can exceed.\nrm -f -r conftest* confdefs.h\n\nprintf \"%s\\n\" \"/* confdefs.h */\" > confdefs.h\n\n# Predefined preprocessor variables.\n\nprintf \"%s\\n\" \"#define PACKAGE_NAME \\\"$PACKAGE_NAME\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_TARNAME \\\"$PACKAGE_TARNAME\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_VERSION \\\"$PACKAGE_VERSION\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_STRING \\\"$PACKAGE_STRING\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_BUGREPORT \\\"$PACKAGE_BUGREPORT\\\"\" >>confdefs.h\n\nprintf \"%s\\n\" \"#define PACKAGE_URL \\\"$PACKAGE_URL\\\"\" >>confdefs.h\n\n\n# Let the site file select an alternate cache file if it wants to.\n# Prefer an explicitly selected file to automatically selected ones.\nif test -n \"$CONFIG_SITE\"; then\n  ac_site_files=\"$CONFIG_SITE\"\nelif test \"x$prefix\" != xNONE; then\n  ac_site_files=\"$prefix/share/config.site $prefix/etc/config.site\"\nelse\n  ac_site_files=\"$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site\"\nfi\n\nfor ac_site_file in $ac_site_files\ndo\n  case $ac_site_file in #(\n  */*) :\n     ;; #(\n  *) :\n    ac_site_file=./$ac_site_file ;;\nesac\n  if test -f \"$ac_site_file\" && test -r \"$ac_site_file\"; then\n    { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file\" >&5\nprintf \"%s\\n\" \"$as_me: loading site script $ac_site_file\" >&6;}\n    sed 's/^/| /' \"$ac_site_file\" >&5\n    . \"$ac_site_file\" \\\n      || { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error $? \"failed to load site script $ac_site_file\nSee 'config.log' for more details\" \"$LINENO\" 5; }\n  fi\ndone\n\nif test -r \"$cache_file\"; then\n  # Some versions of bash will fail to source /dev/null (special files\n  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.\n  if test /dev/null != \"$cache_file\" && test -f \"$cache_file\"; then\n    { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: loading cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: loading cache $cache_file\" >&6;}\n    case $cache_file in\n      [\\\\/]* | ?:[\\\\/]* ) . \"$cache_file\";;\n      *)                      . \"./$cache_file\";;\n    esac\n  fi\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: creating cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: creating cache $cache_file\" >&6;}\n  >$cache_file\nfi\n\n# Test code for whether the C compiler supports C89 (global declarations)\nac_c_conftest_c89_globals='\n/* Does the compiler advertise C89 conformance?\n   Do not test the value of __STDC__, because some compilers set it to 0\n   while being otherwise adequately conformant. */\n#if !defined __STDC__\n# error \"Compiler does not advertise C89 conformance\"\n#endif\n\n#include <stddef.h>\n#include <stdarg.h>\nstruct stat;\n/* Most of the following tests are stolen from RCS 5.7 src/conf.sh.  */\nstruct buf { int x; };\nstruct buf * (*rcsopen) (struct buf *, struct stat *, int);\nstatic char *e (char **p, int i)\n{\n  return p[i];\n}\nstatic char *f (char * (*g) (char **, int), char **p, ...)\n{\n  char *s;\n  va_list v;\n  va_start (v,p);\n  s = g (p, va_arg (v,int));\n  va_end (v);\n  return s;\n}\n\n/* C89 style stringification. */\n#define noexpand_stringify(a) #a\nconst char *stringified = noexpand_stringify(arbitrary+token=sequence);\n\n/* C89 style token pasting.  Exercises some of the corner cases that\n   e.g. old MSVC gets wrong, but not very hard. */\n#define noexpand_concat(a,b) a##b\n#define expand_concat(a,b) noexpand_concat(a,b)\nextern int vA;\nextern int vbee;\n#define aye A\n#define bee B\nint *pvA = &expand_concat(v,aye);\nint *pvbee = &noexpand_concat(v,bee);\n\n/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has\n   function prototypes and stuff, but not \\xHH hex character constants.\n   These do not provoke an error unfortunately, instead are silently treated\n   as an \"x\".  The following induces an error, until -std is added to get\n   proper ANSI mode.  Curiously \\x00 != x always comes out true, for an\n   array size at least.  It is necessary to write \\x00 == 0 to get something\n   that is true only with -std.  */\nint osf4_cc_array ['\\''\\x00'\\'' == 0 ? 1 : -1];\n\n/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters\n   inside strings and character constants.  */\n#define FOO(x) '\\''x'\\''\nint xlc6_cc_array[FOO(a) == '\\''x'\\'' ? 1 : -1];\n\nint test (int i, double x);\nstruct s1 {int (*f) (int a);};\nstruct s2 {int (*f) (double a);};\nint pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),\n               int, int);'\n\n# Test code for whether the C compiler supports C89 (body of main).\nac_c_conftest_c89_main='\nok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);\n'\n\n# Test code for whether the C compiler supports C99 (global declarations)\nac_c_conftest_c99_globals='\n/* Does the compiler advertise C99 conformance? */\n#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L\n# error \"Compiler does not advertise C99 conformance\"\n#endif\n\n// See if C++-style comments work.\n\n#include <stdbool.h>\nextern int puts (const char *);\nextern int printf (const char *, ...);\nextern int dprintf (int, const char *, ...);\nextern void *malloc (size_t);\nextern void free (void *);\n\n// Check varargs macros.  These examples are taken from C99 6.10.3.5.\n// dprintf is used instead of fprintf to avoid needing to declare\n// FILE and stderr.\n#define debug(...) dprintf (2, __VA_ARGS__)\n#define showlist(...) puts (#__VA_ARGS__)\n#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))\nstatic void\ntest_varargs_macros (void)\n{\n  int x = 1234;\n  int y = 5678;\n  debug (\"Flag\");\n  debug (\"X = %d\\n\", x);\n  showlist (The first, second, and third items.);\n  report (x>y, \"x is %d but y is %d\", x, y);\n}\n\n// Check long long types.\n#define BIG64 18446744073709551615ull\n#define BIG32 4294967295ul\n#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)\n#if !BIG_OK\n  #error \"your preprocessor is broken\"\n#endif\n#if BIG_OK\n#else\n  #error \"your preprocessor is broken\"\n#endif\nstatic long long int bignum = -9223372036854775807LL;\nstatic unsigned long long int ubignum = BIG64;\n\nstruct incomplete_array\n{\n  int datasize;\n  double data[];\n};\n\nstruct named_init {\n  int number;\n  const wchar_t *name;\n  double average;\n};\n\ntypedef const char *ccp;\n\nstatic inline int\ntest_restrict (ccp restrict text)\n{\n  // Iterate through items via the restricted pointer.\n  // Also check for declarations in for loops.\n  for (unsigned int i = 0; *(text+i) != '\\''\\0'\\''; ++i)\n    continue;\n  return 0;\n}\n\n// Check varargs and va_copy.\nstatic bool\ntest_varargs (const char *format, ...)\n{\n  va_list args;\n  va_start (args, format);\n  va_list args_copy;\n  va_copy (args_copy, args);\n\n  const char *str = \"\";\n  int number = 0;\n  float fnumber = 0;\n\n  while (*format)\n    {\n      switch (*format++)\n\t{\n\tcase '\\''s'\\'': // string\n\t  str = va_arg (args_copy, const char *);\n\t  break;\n\tcase '\\''d'\\'': // int\n\t  number = va_arg (args_copy, int);\n\t  break;\n\tcase '\\''f'\\'': // float\n\t  fnumber = va_arg (args_copy, double);\n\t  break;\n\tdefault:\n\t  break;\n\t}\n    }\n  va_end (args_copy);\n  va_end (args);\n\n  return *str && number && fnumber;\n}\n'\n\n# Test code for whether the C compiler supports C99 (body of main).\nac_c_conftest_c99_main='\n  // Check bool.\n  _Bool success = false;\n  success |= (argc != 0);\n\n  // Check restrict.\n  if (test_restrict (\"String literal\") == 0)\n    success = true;\n  char *restrict newvar = \"Another string\";\n\n  // Check varargs.\n  success &= test_varargs (\"s, d'\\'' f .\", \"string\", 65, 34.234);\n  test_varargs_macros ();\n\n  // Check flexible array members.\n  struct incomplete_array *ia =\n    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));\n  ia->datasize = 10;\n  for (int i = 0; i < ia->datasize; ++i)\n    ia->data[i] = i * 1.234;\n  // Work around memory leak warnings.\n  free (ia);\n\n  // Check named initializers.\n  struct named_init ni = {\n    .number = 34,\n    .name = L\"Test wide string\",\n    .average = 543.34343,\n  };\n\n  ni.number = 58;\n\n  int dynamic_array[ni.number];\n  dynamic_array[0] = argv[0][0];\n  dynamic_array[ni.number - 1] = 543;\n\n  // work around unused variable warnings\n  ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\\''x'\\''\n\t || dynamic_array[ni.number - 1] != 543);\n'\n\n# Test code for whether the C compiler supports C11 (global declarations)\nac_c_conftest_c11_globals='\n/* Does the compiler advertise C11 conformance? */\n#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L\n# error \"Compiler does not advertise C11 conformance\"\n#endif\n\n// Check _Alignas.\nchar _Alignas (double) aligned_as_double;\nchar _Alignas (0) no_special_alignment;\nextern char aligned_as_int;\nchar _Alignas (0) _Alignas (int) aligned_as_int;\n\n// Check _Alignof.\nenum\n{\n  int_alignment = _Alignof (int),\n  int_array_alignment = _Alignof (int[100]),\n  char_alignment = _Alignof (char)\n};\n_Static_assert (0 < -_Alignof (int), \"_Alignof is signed\");\n\n// Check _Noreturn.\nint _Noreturn does_not_return (void) { for (;;) continue; }\n\n// Check _Static_assert.\nstruct test_static_assert\n{\n  int x;\n  _Static_assert (sizeof (int) <= sizeof (long int),\n                  \"_Static_assert does not work in struct\");\n  long int y;\n};\n\n// Check UTF-8 literals.\n#define u8 syntax error!\nchar const utf8_literal[] = u8\"happens to be ASCII\" \"another string\";\n\n// Check duplicate typedefs.\ntypedef long *long_ptr;\ntypedef long int *long_ptr;\ntypedef long_ptr long_ptr;\n\n// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.\nstruct anonymous\n{\n  union {\n    struct { int i; int j; };\n    struct { int k; long int l; } w;\n  };\n  int m;\n} v1;\n'\n\n# Test code for whether the C compiler supports C11 (body of main).\nac_c_conftest_c11_main='\n  _Static_assert ((offsetof (struct anonymous, i)\n\t\t   == offsetof (struct anonymous, w.k)),\n\t\t  \"Anonymous union alignment botch\");\n  v1.i = 2;\n  v1.w.k = 5;\n  ok |= v1.i != 5;\n'\n\n# Test code for whether the C compiler supports C11 (complete).\nac_c_conftest_c11_program=\"${ac_c_conftest_c89_globals}\n${ac_c_conftest_c99_globals}\n${ac_c_conftest_c11_globals}\n\nint\nmain (int argc, char **argv)\n{\n  int ok = 0;\n  ${ac_c_conftest_c89_main}\n  ${ac_c_conftest_c99_main}\n  ${ac_c_conftest_c11_main}\n  return ok;\n}\n\"\n\n# Test code for whether the C compiler supports C99 (complete).\nac_c_conftest_c99_program=\"${ac_c_conftest_c89_globals}\n${ac_c_conftest_c99_globals}\n\nint\nmain (int argc, char **argv)\n{\n  int ok = 0;\n  ${ac_c_conftest_c89_main}\n  ${ac_c_conftest_c99_main}\n  return ok;\n}\n\"\n\n# Test code for whether the C compiler supports C89 (complete).\nac_c_conftest_c89_program=\"${ac_c_conftest_c89_globals}\n\nint\nmain (int argc, char **argv)\n{\n  int ok = 0;\n  ${ac_c_conftest_c89_main}\n  return ok;\n}\n\"\n\nas_fn_append ac_header_c_list \" stdio.h stdio_h HAVE_STDIO_H\"\nas_fn_append ac_header_c_list \" stdlib.h stdlib_h HAVE_STDLIB_H\"\nas_fn_append ac_header_c_list \" string.h string_h HAVE_STRING_H\"\nas_fn_append ac_header_c_list \" inttypes.h inttypes_h HAVE_INTTYPES_H\"\nas_fn_append ac_header_c_list \" stdint.h stdint_h HAVE_STDINT_H\"\nas_fn_append ac_header_c_list \" strings.h strings_h HAVE_STRINGS_H\"\nas_fn_append ac_header_c_list \" sys/stat.h sys_stat_h HAVE_SYS_STAT_H\"\nas_fn_append ac_header_c_list \" sys/types.h sys_types_h HAVE_SYS_TYPES_H\"\nas_fn_append ac_header_c_list \" unistd.h unistd_h HAVE_UNISTD_H\"\nas_fn_append ac_header_c_list \" sys/time.h sys_time_h HAVE_SYS_TIME_H\"\n\n# Auxiliary files required by this configure script.\nac_aux_files=\"install-sh config.guess config.sub\"\n\n# Locations in which to look for auxiliary files.\nac_aux_dir_candidates=\"${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../..\"\n\n# Search for a directory containing all of the required auxiliary files,\n# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.\n# If we don't find one directory that contains all the files we need,\n# we report the set of missing files from the *first* directory in\n# $ac_aux_dir_candidates and give up.\nac_missing_aux_files=\"\"\nac_first_candidate=:\nprintf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files\" >&5\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nas_found=false\nfor as_dir in $ac_aux_dir_candidates\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n  as_found=:\n\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:  trying $as_dir\" >&5\n  ac_aux_dir_found=yes\n  ac_install_sh=\n  for ac_aux in $ac_aux_files\n  do\n    # As a special case, if \"install-sh\" is required, that requirement\n    # can be satisfied by any of \"install-sh\", \"install.sh\", or \"shtool\",\n    # and $ac_install_sh is set appropriately for whichever one is found.\n    if test x\"$ac_aux\" = x\"install-sh\"\n    then\n      if test -f \"${as_dir}install-sh\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}install-sh found\" >&5\n        ac_install_sh=\"${as_dir}install-sh -c\"\n      elif test -f \"${as_dir}install.sh\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}install.sh found\" >&5\n        ac_install_sh=\"${as_dir}install.sh -c\"\n      elif test -f \"${as_dir}shtool\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}shtool found\" >&5\n        ac_install_sh=\"${as_dir}shtool install -c\"\n      else\n        ac_aux_dir_found=no\n        if $ac_first_candidate; then\n          ac_missing_aux_files=\"${ac_missing_aux_files} install-sh\"\n        else\n          break\n        fi\n      fi\n    else\n      if test -f \"${as_dir}${ac_aux}\"; then\n        printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   ${as_dir}${ac_aux} found\" >&5\n      else\n        ac_aux_dir_found=no\n        if $ac_first_candidate; then\n          ac_missing_aux_files=\"${ac_missing_aux_files} ${ac_aux}\"\n        else\n          break\n        fi\n      fi\n    fi\n  done\n  if test \"$ac_aux_dir_found\" = yes; then\n    ac_aux_dir=\"$as_dir\"\n    break\n  fi\n  ac_first_candidate=false\n\n  as_found=false\ndone\nIFS=$as_save_IFS\nif $as_found\nthen :\n\nelse case e in #(\n  e) as_fn_error $? \"cannot find required auxiliary files:$ac_missing_aux_files\" \"$LINENO\" 5 ;;\nesac\nfi\n\n\n# These three variables are undocumented and unsupported,\n# and are intended to be withdrawn in a future Autoconf release.\n# They can cause serious problems if a builder's source tree is in a directory\n# whose full name contains unusual characters.\nif test -f \"${ac_aux_dir}config.guess\"; then\n  ac_config_guess=\"$SHELL ${ac_aux_dir}config.guess\"\nfi\nif test -f \"${ac_aux_dir}config.sub\"; then\n  ac_config_sub=\"$SHELL ${ac_aux_dir}config.sub\"\nfi\nif test -f \"$ac_aux_dir/configure\"; then\n  ac_configure=\"$SHELL ${ac_aux_dir}configure\"\nfi\n\n# Check that the precious variables saved in the cache have kept the same\n# value.\nac_cache_corrupted=false\nfor ac_var in $ac_precious_vars; do\n  eval ac_old_set=\\$ac_cv_env_${ac_var}_set\n  eval ac_new_set=\\$ac_env_${ac_var}_set\n  eval ac_old_val=\\$ac_cv_env_${ac_var}_value\n  eval ac_new_val=\\$ac_env_${ac_var}_value\n  case $ac_old_set,$ac_new_set in\n    set,)\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run\" >&5\nprintf \"%s\\n\" \"$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,set)\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run\" >&5\nprintf \"%s\\n\" \"$as_me: error: '$ac_var' was not set in the previous run\" >&2;}\n      ac_cache_corrupted=: ;;\n    ,);;\n    *)\n      if test \"x$ac_old_val\" != \"x$ac_new_val\"; then\n\t# differences in whitespace do not lead to failure.\n\tac_old_val_w=`echo x $ac_old_val`\n\tac_new_val_w=`echo x $ac_new_val`\n\tif test \"$ac_old_val_w\" != \"$ac_new_val_w\"; then\n\t  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:\" >&5\nprintf \"%s\\n\" \"$as_me: error: '$ac_var' has changed since the previous run:\" >&2;}\n\t  ac_cache_corrupted=:\n\telse\n\t  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:\" >&5\nprintf \"%s\\n\" \"$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:\" >&2;}\n\t  eval $ac_var=\\$ac_old_val\n\tfi\n\t{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   former value:  '$ac_old_val'\" >&5\nprintf \"%s\\n\" \"$as_me:   former value:  '$ac_old_val'\" >&2;}\n\t{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}:   current value: '$ac_new_val'\" >&5\nprintf \"%s\\n\" \"$as_me:   current value: '$ac_new_val'\" >&2;}\n      fi;;\n  esac\n  # Pass precious variables to config.status.\n  if test \"$ac_new_set\" = set; then\n    case $ac_new_val in\n    *\\'*) ac_arg=$ac_var=`printf \"%s\\n\" \"$ac_new_val\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    *) ac_arg=$ac_var=$ac_new_val ;;\n    esac\n    case \" $ac_configure_args \" in\n      *\" '$ac_arg' \"*) ;; # Avoid dups.  Use of quotes ensures accuracy.\n      *) as_fn_append ac_configure_args \" '$ac_arg'\" ;;\n    esac\n  fi\ndone\nif $ac_cache_corrupted; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build\" >&5\nprintf \"%s\\n\" \"$as_me: error: changes in the environment can compromise the build\" >&2;}\n  as_fn_error $? \"run '${MAKE-make} distclean' and/or 'rm $cache_file'\n\t    and start over\" \"$LINENO\" 5\nfi\n## -------------------- ##\n## Main body of script. ##\n## -------------------- ##\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n\n\nac_config_headers=\"$ac_config_headers config.h\"\n\n\n\n\n  # Make sure we can run config.sub.\n$SHELL \"${ac_aux_dir}config.sub\" sun4 >/dev/null 2>&1 ||\n  as_fn_error $? \"cannot run $SHELL ${ac_aux_dir}config.sub\" \"$LINENO\" 5\n\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking build system type\" >&5\nprintf %s \"checking build system type... \" >&6; }\nif test ${ac_cv_build+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_build_alias=$build_alias\ntest \"x$ac_build_alias\" = x &&\n  ac_build_alias=`$SHELL \"${ac_aux_dir}config.guess\"`\ntest \"x$ac_build_alias\" = x &&\n  as_fn_error $? \"cannot guess build type; you must specify one\" \"$LINENO\" 5\nac_cv_build=`$SHELL \"${ac_aux_dir}config.sub\" $ac_build_alias` ||\n  as_fn_error $? \"$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed\" \"$LINENO\" 5\n ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_build\" >&5\nprintf \"%s\\n\" \"$ac_cv_build\" >&6; }\ncase $ac_cv_build in\n*-*-*) ;;\n*) as_fn_error $? \"invalid value of canonical build\" \"$LINENO\" 5;;\nesac\nbuild=$ac_cv_build\nac_save_IFS=$IFS; IFS='-'\nset x $ac_cv_build\nshift\nbuild_cpu=$1\nbuild_vendor=$2\nshift; shift\n# Remember, the first character of IFS is used to create $*,\n# except with old shells:\nbuild_os=$*\nIFS=$ac_save_IFS\ncase $build_os in *\\ *) build_os=`echo \"$build_os\" | sed 's/ /-/g'`;; esac\n\n\n\n# Checks for programs.\n\n  # Find a good install program.  We prefer a C program (faster),\n# so one script is as good as another.  But avoid the broken or\n# incompatible versions:\n# SysV /etc/install, /usr/sbin/install\n# SunOS /usr/etc/install\n# IRIX /sbin/install\n# AIX /bin/install\n# AmigaOS /C/install, which installs bootblocks on floppy discs\n# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag\n# AFS /usr/afsws/bin/install, which mishandles nonexistent args\n# SVR4 /usr/ucb/install, which tries to use the nonexistent group \"staff\"\n# OS/2's system install, which has a completely different semantic\n# ./install, which can be erroneously created by make from ./install.sh.\n# Reject install programs that cannot install multiple files.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install\" >&5\nprintf %s \"checking for a BSD-compatible install... \" >&6; }\nif test -z \"$INSTALL\"; then\nif test ${ac_cv_path_install+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    # Account for fact that we put trailing slashes in our PATH walk.\ncase $as_dir in #((\n  ./ | /[cC]/* | \\\n  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \\\n  ?:[\\\\/]os2[\\\\/]install[\\\\/]* | ?:[\\\\/]OS2[\\\\/]INSTALL[\\\\/]* | \\\n  /usr/ucb/* ) ;;\n  *)\n    # OSF1 and SCO ODT 3.0 have their own names for install.\n    # Don't use installbsd from OSF since it installs stuff as root\n    # by default.\n    for ac_prog in ginstall scoinst install; do\n      for ac_exec_ext in '' $ac_executable_extensions; do\n\tif as_fn_executable_p \"$as_dir$ac_prog$ac_exec_ext\"; then\n\t  if test $ac_prog = install &&\n\t    grep dspmsg \"$as_dir$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # AIX install.  It has an incompatible calling convention.\n\t    :\n\t  elif test $ac_prog = install &&\n\t    grep pwplus \"$as_dir$ac_prog$ac_exec_ext\" >/dev/null 2>&1; then\n\t    # program-specific install script used by HP pwplus--don't use.\n\t    :\n\t  else\n\t    rm -rf conftest.one conftest.two conftest.dir\n\t    echo one > conftest.one\n\t    echo two > conftest.two\n\t    mkdir conftest.dir\n\t    if \"$as_dir$ac_prog$ac_exec_ext\" -c conftest.one conftest.two \"`pwd`/conftest.dir/\" &&\n\t      test -s conftest.one && test -s conftest.two &&\n\t      test -s conftest.dir/conftest.one &&\n\t      test -s conftest.dir/conftest.two\n\t    then\n\t      ac_cv_path_install=\"$as_dir$ac_prog$ac_exec_ext -c\"\n\t      break 3\n\t    fi\n\t  fi\n\tfi\n      done\n    done\n    ;;\nesac\n\n  done\nIFS=$as_save_IFS\n\nrm -rf conftest.one conftest.two conftest.dir\n ;;\nesac\nfi\n  if test ${ac_cv_path_install+y}; then\n    INSTALL=$ac_cv_path_install\n  else\n    # As a last resort, use the slow shell script.  Don't cache a\n    # value for INSTALL within a source directory, because that will\n    # break other packages using the cache if that directory is\n    # removed, or if the value is a relative name.\n    INSTALL=$ac_install_sh\n  fi\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $INSTALL\" >&5\nprintf \"%s\\n\" \"$INSTALL\" >&6; }\n\n# Use test -z because SunOS4 sh mishandles braces in ${var-val}.\n# It thinks the first close brace ends the variable substitution.\ntest -z \"$INSTALL_PROGRAM\" && INSTALL_PROGRAM='${INSTALL}'\n\ntest -z \"$INSTALL_SCRIPT\" && INSTALL_SCRIPT='${INSTALL}'\n\ntest -z \"$INSTALL_DATA\" && INSTALL_DATA='${INSTALL} -m 644'\n\n\n\n\n\n\n\n\n\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\nif test -n \"$ac_tool_prefix\"; then\n  for ac_prog in gcc cc\n  do\n    # Extract the first word of \"$ac_tool_prefix$ac_prog\", so it can be a program name with args.\nset dummy $ac_tool_prefix$ac_prog; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) if test -n \"$CC\"; then\n  ac_cv_prog_CC=\"$CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_CC=\"$ac_tool_prefix$ac_prog\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi ;;\nesac\nfi\nCC=$ac_cv_prog_CC\nif test -n \"$CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $CC\" >&5\nprintf \"%s\\n\" \"$CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\n    test -n \"$CC\" && break\n  done\nfi\nif test -z \"$CC\"; then\n  ac_ct_CC=$CC\n  for ac_prog in gcc cc\ndo\n  # Extract the first word of \"$ac_prog\", so it can be a program name with args.\nset dummy $ac_prog; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_prog_ac_ct_CC+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) if test -n \"$ac_ct_CC\"; then\n  ac_cv_prog_ac_ct_CC=\"$ac_ct_CC\" # Let the user override the test.\nelse\nas_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_prog_ac_ct_CC=\"$ac_prog\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\nfi ;;\nesac\nfi\nac_ct_CC=$ac_cv_prog_ac_ct_CC\nif test -n \"$ac_ct_CC\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC\" >&5\nprintf \"%s\\n\" \"$ac_ct_CC\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\n  test -n \"$ac_ct_CC\" && break\ndone\n\n  if test \"x$ac_ct_CC\" = x; then\n    CC=\"\"\n  else\n    case $cross_compiling:$ac_tool_warned in\nyes:)\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: using cross tools not prefixed with host triplet\" >&2;}\nac_tool_warned=yes ;;\nesac\n    CC=$ac_ct_CC\n  fi\nfi\n\n\ntest -z \"$CC\" && { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error $? \"no acceptable C compiler found in \\$PATH\nSee 'config.log' for more details\" \"$LINENO\" 5; }\n\n# Provide some information about the compiler.\nprintf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for C compiler version\" >&5\nset X $ac_compile\nac_compiler=$2\nfor ac_option in --version -v -V -qversion -version; do\n  { { ac_try=\"$ac_compiler $ac_option >&5\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compiler $ac_option >&5\") 2>conftest.err\n  ac_status=$?\n  if test -s conftest.err; then\n    sed '10a\\\n... rest of stderr output deleted ...\n         10q' conftest.err >conftest.er1\n    cat conftest.er1 >&5\n  fi\n  rm -f conftest.er1 conftest.err\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\ndone\n\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files a.out a.out.dSYM a.exe b.out\"\n# Try to create an executable without -o first, disregard a.out.\n# It will help us diagnose broken compilers, and finding out an intuition\n# of exeext.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether the C compiler works\" >&5\nprintf %s \"checking whether the C compiler works... \" >&6; }\nac_link_default=`printf \"%s\\n\" \"$ac_link\" | sed 's/ -o *conftest[^ ]*//'`\n\n# The possible output files:\nac_files=\"a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*\"\n\nac_rmfiles=\nfor ac_file in $ac_files\ndo\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    * ) ac_rmfiles=\"$ac_rmfiles $ac_file\";;\n  esac\ndone\nrm -f $ac_rmfiles\n\nif { { ac_try=\"$ac_link_default\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link_default\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\nthen :\n  # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'.\n# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no'\n# in a Makefile.  We should not override ac_cv_exeext if it was cached,\n# so that the user can short-circuit this test for compilers unknown to\n# Autoconf.\nfor ac_file in $ac_files ''\ndo\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )\n\t;;\n    [ab].out )\n\t# We found the default executable, but exeext='' is most\n\t# certainly right.\n\tbreak;;\n    *.* )\n\tif test ${ac_cv_exeext+y} && test \"$ac_cv_exeext\" != no;\n\tthen :; else\n\t   ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\tfi\n\t# We set ac_cv_exeext here because the later test for it is not\n\t# safe: cross compilers may not add the suffix if given an '-o'\n\t# argument, so we may need to know it at that point already.\n\t# Even if this section looks crufty: it has the advantage of\n\t# actually working.\n\tbreak;;\n    * )\n\tbreak;;\n  esac\ndone\ntest \"$ac_cv_exeext\" = no && ac_cv_exeext=\n\nelse case e in #(\n  e) ac_file='' ;;\nesac\nfi\nif test -z \"$ac_file\"\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nprintf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error 77 \"C compiler cannot create executables\nSee 'config.log' for more details\" \"$LINENO\" 5; }\nelse case e in #(\n  e) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\nprintf \"%s\\n\" \"yes\" >&6; } ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name\" >&5\nprintf %s \"checking for C compiler default output file name... \" >&6; }\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_file\" >&5\nprintf \"%s\\n\" \"$ac_file\" >&6; }\nac_exeext=$ac_cv_exeext\n\nrm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out\nac_clean_files=$ac_clean_files_save\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for suffix of executables\" >&5\nprintf %s \"checking for suffix of executables... \" >&6; }\nif { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\nthen :\n  # If both 'conftest.exe' and 'conftest' are 'present' (well, observable)\n# catch 'conftest.exe'.  For instance with Cygwin, 'ls conftest' will\n# work properly (i.e., refer to 'conftest.exe'), while it won't with\n# 'rm'.\nfor ac_file in conftest.exe conftest conftest.*; do\n  test -f \"$ac_file\" || continue\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;\n    *.* ) ac_cv_exeext=`expr \"$ac_file\" : '[^.]*\\(\\..*\\)'`\n\t  break;;\n    * ) break;;\n  esac\ndone\nelse case e in #(\n  e) { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of executables: cannot compile and link\nSee 'config.log' for more details\" \"$LINENO\" 5; } ;;\nesac\nfi\nrm -f conftest conftest$ac_cv_exeext\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext\" >&5\nprintf \"%s\\n\" \"$ac_cv_exeext\" >&6; }\n\nrm -f conftest.$ac_ext\nEXEEXT=$ac_cv_exeext\nac_exeext=$EXEEXT\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <stdio.h>\nint\nmain (void)\n{\nFILE *f = fopen (\"conftest.out\", \"w\");\n if (!f)\n  return 1;\n return ferror (f) || fclose (f) != 0;\n\n  ;\n  return 0;\n}\n_ACEOF\nac_clean_files=\"$ac_clean_files conftest.out\"\n# Check that the compiler produces executables we can run.  If not, either\n# the compiler is broken, or we cross compile.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling\" >&5\nprintf %s \"checking whether we are cross compiling... \" >&6; }\nif test \"$cross_compiling\" != yes; then\n  { { ac_try=\"$ac_link\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_link\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\n  if { ac_try='./conftest$ac_cv_exeext'\n  { { case \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_try\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }; }; then\n    cross_compiling=no\n  else\n    if test \"$cross_compiling\" = maybe; then\n\tcross_compiling=yes\n    else\n\t{ { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error 77 \"cannot run C compiled programs.\nIf you meant to cross compile, use '--host'.\nSee 'config.log' for more details\" \"$LINENO\" 5; }\n    fi\n  fi\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $cross_compiling\" >&5\nprintf \"%s\\n\" \"$cross_compiling\" >&6; }\n\nrm -f conftest.$ac_ext conftest$ac_cv_exeext \\\n  conftest.o conftest.obj conftest.out\nac_clean_files=$ac_clean_files_save\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for suffix of object files\" >&5\nprintf %s \"checking for suffix of object files... \" >&6; }\nif test ${ac_cv_objext+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nrm -f conftest.o conftest.obj\nif { { ac_try=\"$ac_compile\"\ncase \"(($ac_try\" in\n  *\\\"* | *\\`* | *\\\\*) ac_try_echo=\\$ac_try;;\n  *) ac_try_echo=$ac_try;;\nesac\neval ac_try_echo=\"\\\"\\$as_me:${as_lineno-$LINENO}: $ac_try_echo\\\"\"\nprintf \"%s\\n\" \"$ac_try_echo\"; } >&5\n  (eval \"$ac_compile\") 2>&5\n  ac_status=$?\n  printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: \\$? = $ac_status\" >&5\n  test $ac_status = 0; }\nthen :\n  for ac_file in conftest.o conftest.obj conftest.*; do\n  test -f \"$ac_file\" || continue;\n  case $ac_file in\n    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;\n    *) ac_cv_objext=`expr \"$ac_file\" : '.*\\.\\(.*\\)'`\n       break;;\n  esac\ndone\nelse case e in #(\n  e) printf \"%s\\n\" \"$as_me: failed program was:\" >&5\nsed 's/^/| /' conftest.$ac_ext >&5\n\n{ { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error $? \"cannot compute suffix of object files: cannot compile\nSee 'config.log' for more details\" \"$LINENO\" 5; } ;;\nesac\nfi\nrm -f conftest.$ac_cv_objext conftest.$ac_ext ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext\" >&5\nprintf \"%s\\n\" \"$ac_cv_objext\" >&6; }\nOBJEXT=$ac_cv_objext\nac_objext=$OBJEXT\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C\" >&5\nprintf %s \"checking whether the compiler supports GNU C... \" >&6; }\nif test ${ac_cv_c_compiler_gnu+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n#ifndef __GNUC__\n       choke me\n#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_compiler_gnu=yes\nelse case e in #(\n  e) ac_compiler_gnu=no ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nac_cv_c_compiler_gnu=$ac_compiler_gnu\n ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu\" >&5\nprintf \"%s\\n\" \"$ac_cv_c_compiler_gnu\" >&6; }\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\nif test $ac_compiler_gnu = yes; then\n  GCC=yes\nelse\n  GCC=\nfi\nac_test_CFLAGS=${CFLAGS+y}\nac_save_CFLAGS=$CFLAGS\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g\" >&5\nprintf %s \"checking whether $CC accepts -g... \" >&6; }\nif test ${ac_cv_prog_cc_g+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_save_c_werror_flag=$ac_c_werror_flag\n   ac_c_werror_flag=yes\n   ac_cv_prog_cc_g=no\n   CFLAGS=\"-g\"\n   cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_g=yes\nelse case e in #(\n  e) CFLAGS=\"\"\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n\nelse case e in #(\n  e) ac_c_werror_flag=$ac_save_c_werror_flag\n\t CFLAGS=\"-g\"\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_g=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n   ac_c_werror_flag=$ac_save_c_werror_flag ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_g\" >&6; }\nif test $ac_test_CFLAGS; then\n  CFLAGS=$ac_save_CFLAGS\nelif test $ac_cv_prog_cc_g = yes; then\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-g -O2\"\n  else\n    CFLAGS=\"-g\"\n  fi\nelse\n  if test \"$GCC\" = yes; then\n    CFLAGS=\"-O2\"\n  else\n    CFLAGS=\n  fi\nfi\nac_prog_cc_stdc=no\nif test x$ac_prog_cc_stdc = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features\" >&5\nprintf %s \"checking for $CC option to enable C11 features... \" >&6; }\nif test ${ac_cv_prog_cc_c11+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_cv_prog_cc_c11=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_c_conftest_c11_program\n_ACEOF\nfor ac_arg in '' -std=gnu11\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_c11=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam\n  test \"x$ac_cv_prog_cc_c11\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC ;;\nesac\nfi\n\nif test \"x$ac_cv_prog_cc_c11\" = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\nprintf \"%s\\n\" \"unsupported\" >&6; }\nelse case e in #(\n  e) if test \"x$ac_cv_prog_cc_c11\" = x\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\nprintf \"%s\\n\" \"none needed\" >&6; }\nelse case e in #(\n  e) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_c11\" >&6; }\n     CC=\"$CC $ac_cv_prog_cc_c11\" ;;\nesac\nfi\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11\n  ac_prog_cc_stdc=c11 ;;\nesac\nfi\nfi\nif test x$ac_prog_cc_stdc = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features\" >&5\nprintf %s \"checking for $CC option to enable C99 features... \" >&6; }\nif test ${ac_cv_prog_cc_c99+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_cv_prog_cc_c99=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_c_conftest_c99_program\n_ACEOF\nfor ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_c99=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam\n  test \"x$ac_cv_prog_cc_c99\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC ;;\nesac\nfi\n\nif test \"x$ac_cv_prog_cc_c99\" = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\nprintf \"%s\\n\" \"unsupported\" >&6; }\nelse case e in #(\n  e) if test \"x$ac_cv_prog_cc_c99\" = x\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\nprintf \"%s\\n\" \"none needed\" >&6; }\nelse case e in #(\n  e) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_c99\" >&6; }\n     CC=\"$CC $ac_cv_prog_cc_c99\" ;;\nesac\nfi\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99\n  ac_prog_cc_stdc=c99 ;;\nesac\nfi\nfi\nif test x$ac_prog_cc_stdc = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features\" >&5\nprintf %s \"checking for $CC option to enable C89 features... \" >&6; }\nif test ${ac_cv_prog_cc_c89+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_cv_prog_cc_c89=no\nac_save_CC=$CC\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_c_conftest_c89_program\n_ACEOF\nfor ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae \"-Aa -D_HPUX_SOURCE\" \"-Xc -D__EXTENSIONS__\"\ndo\n  CC=\"$ac_save_CC $ac_arg\"\n  if ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_prog_cc_c89=$ac_arg\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam\n  test \"x$ac_cv_prog_cc_c89\" != \"xno\" && break\ndone\nrm -f conftest.$ac_ext\nCC=$ac_save_CC ;;\nesac\nfi\n\nif test \"x$ac_cv_prog_cc_c89\" = xno\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: unsupported\" >&5\nprintf \"%s\\n\" \"unsupported\" >&6; }\nelse case e in #(\n  e) if test \"x$ac_cv_prog_cc_c89\" = x\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: none needed\" >&5\nprintf \"%s\\n\" \"none needed\" >&6; }\nelse case e in #(\n  e) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89\" >&5\nprintf \"%s\\n\" \"$ac_cv_prog_cc_c89\" >&6; }\n     CC=\"$CC $ac_cv_prog_cc_c89\" ;;\nesac\nfi\n  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89\n  ac_prog_cc_stdc=c89 ;;\nesac\nfi\nfi\n\nac_ext=c\nac_cpp='$CPP $CPPFLAGS'\nac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'\nac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'\nac_compiler_gnu=$ac_cv_c_compiler_gnu\n\n# add -Wall to CFLAGS for gcc\nif test \"$GCC\" = yes; then CFLAGS=\"-Wall $CFLAGS\"; fi\n\n# check if ld supports -rpath\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether the linker supports -rpath\" >&5\nprintf %s \"checking whether the linker supports -rpath... \" >&6; }\nsave_LDFLAGS=\"$LDFLAGS\"\nLDFLAGS=\"$LDFLAGS -Wl,-rpath,/usr/lib\"\n\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\nmain() {}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"\nthen :\n  rpath=yes\nelse case e in #(\n  e) rpath=no ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam \\\n    conftest$ac_exeext conftest.$ac_ext\nLDFLAGS=\"$save_LDFLAGS\"\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $rpath\" >&5\nprintf \"%s\\n\" \"$rpath\" >&6; }\n\n\n# Check whether --with-postgres was given.\nif test ${with_postgres+y}\nthen :\n  withval=$with_postgres; if ! test -x \"$with_postgres\"/pg_config; then\n\t\techo \"*** pg_config not found in '$with_postgres'\" 1>&2\n\t\texit 1\n\tfi\n\tpgbindir=`\"$with_postgres\"/pg_config --bindir`\n\n\tif test $build_os = mingw32; then pglibdir=\"$pgbindir\"; else pglibdir=`\"$with_postgres\"/pg_config --libdir`; fi\n\tpgincludedir=`\"$with_postgres\"/pg_config --includedir`\n\tLDFLAGS=\"$LDFLAGS -L$pglibdir\"\n\tif test $rpath = yes; then LDFLAGS=\"$LDFLAGS -Wl,-rpath,$pglibdir\"; fi\n\tCFLAGS=\"$CFLAGS -I$pgincludedir\"\n\tPATH=`\"$with_postgres\"/pg_config --bindir`:$PATH\nfi\n\n\n# Install with PostgreSQL by default\nif test \"x$prefix\" = xNONE; then\n  printf %s \"checking for prefix by \" >&6\n  # Extract the first word of \"pg_config\", so it can be a program name with args.\nset dummy pg_config; ac_word=$2\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $ac_word\" >&5\nprintf %s \"checking for $ac_word... \" >&6; }\nif test ${ac_cv_path_ac_prefix_program+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) case $ac_prefix_program in\n  [\\\\/]* | ?:[\\\\/]*)\n  ac_cv_path_ac_prefix_program=\"$ac_prefix_program\" # Let the user override the test with a path.\n  ;;\n  *)\n  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    for ac_exec_ext in '' $ac_executable_extensions; do\n  if as_fn_executable_p \"$as_dir$ac_word$ac_exec_ext\"; then\n    ac_cv_path_ac_prefix_program=\"$as_dir$ac_word$ac_exec_ext\"\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext\" >&5\n    break 2\n  fi\ndone\n  done\nIFS=$as_save_IFS\n\n  ;;\nesac ;;\nesac\nfi\nac_prefix_program=$ac_cv_path_ac_prefix_program\nif test -n \"$ac_prefix_program\"; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_prefix_program\" >&5\nprintf \"%s\\n\" \"$ac_prefix_program\" >&6; }\nelse\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: no\" >&5\nprintf \"%s\\n\" \"no\" >&6; }\nfi\n\n\n  if test -n \"$ac_prefix_program\"; then\n    prefix=`$as_dirname -- \"$ac_prefix_program\" ||\n$as_expr X\"$ac_prefix_program\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_prefix_program\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_prefix_program\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_prefix_program\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$ac_prefix_program\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n    prefix=`$as_dirname -- \"$prefix\" ||\n$as_expr X\"$prefix\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$prefix\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$prefix\" : 'X\\(//\\)$' \\| \\\n\t X\"$prefix\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$prefix\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  fi\nfi\n\n\n# Checks for libraries.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for PQsendPrepare in -lpq\" >&5\nprintf %s \"checking for PQsendPrepare in -lpq... \" >&6; }\nif test ${ac_cv_lib_pq_PQsendPrepare+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-lpq  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.\n   The 'extern \"C\"' is for builds by C++ compilers;\n   although this is not generally supported in C code supporting it here\n   has little cost and some practical benefit (sr 110532).  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar PQsendPrepare (void);\nint\nmain (void)\n{\nreturn PQsendPrepare ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"\nthen :\n  ac_cv_lib_pq_PQsendPrepare=yes\nelse case e in #(\n  e) ac_cv_lib_pq_PQsendPrepare=no ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQsendPrepare\" >&5\nprintf \"%s\\n\" \"$ac_cv_lib_pq_PQsendPrepare\" >&6; }\nif test \"x$ac_cv_lib_pq_PQsendPrepare\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_LIBPQ 1\" >>confdefs.h\n\n  LIBS=\"-lpq $LIBS\"\n\nelse case e in #(\n  e) as_fn_error $? \"\n*** cannot locate PostgreSQL client library\n*** required is version 8.0 or better\n\" \"$LINENO\" 5 ;;\nesac\nfi\n\n\n# special Windows settings\nif test $build_os = mingw32; then\n\tEXTRA_OBJS=windows.o\n\n\t# assume socks library is present\n\t# we have a problem using AC_CHECK_LIB because the function is __stdcall\n\tLIBS=\"$LIBS -lwsock32\"\nfi\n\n# Checks for header files.\nac_header= ac_cache=\nfor ac_item in $ac_header_c_list\ndo\n  if test $ac_cache; then\n    ac_fn_c_check_header_compile \"$LINENO\" $ac_header ac_cv_header_$ac_cache \"$ac_includes_default\"\n    if eval test \\\"x\\$ac_cv_header_$ac_cache\\\" = xyes; then\n      printf \"%s\\n\" \"#define $ac_item 1\" >> confdefs.h\n    fi\n    ac_header= ac_cache=\n  elif test $ac_header; then\n    ac_cache=$ac_item\n  else\n    ac_header=$ac_item\n  fi\ndone\n\n\n\n\n\n\n\n\nif test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes\nthen :\n\nprintf \"%s\\n\" \"#define STDC_HEADERS 1\" >>confdefs.h\n\nfi\n\n\n# Obsolete code to be removed.\nif test $ac_cv_header_sys_time_h = yes; then\n\nprintf \"%s\\n\" \"#define TIME_WITH_SYS_TIME 1\" >>confdefs.h\n\nfi\n# End of obsolete code.\n\nac_fn_c_check_header_compile \"$LINENO\" \"fcntl.h\" \"ac_cv_header_fcntl_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_fcntl_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_FCNTL_H 1\" >>confdefs.h\n\nfi\nac_fn_c_check_header_compile \"$LINENO\" \"netinet/in.h\" \"ac_cv_header_netinet_in_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_netinet_in_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_NETINET_IN_H 1\" >>confdefs.h\n\nfi\nac_fn_c_check_header_compile \"$LINENO\" \"stdint.h\" \"ac_cv_header_stdint_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_stdint_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_STDINT_H 1\" >>confdefs.h\n\nfi\nac_fn_c_check_header_compile \"$LINENO\" \"stdlib.h\" \"ac_cv_header_stdlib_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_stdlib_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_STDLIB_H 1\" >>confdefs.h\n\nfi\nac_fn_c_check_header_compile \"$LINENO\" \"string.h\" \"ac_cv_header_string_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_string_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_STRING_H 1\" >>confdefs.h\n\nfi\nac_fn_c_check_header_compile \"$LINENO\" \"sys/time.h\" \"ac_cv_header_sys_time_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_sys_time_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_SYS_TIME_H 1\" >>confdefs.h\n\nfi\nac_fn_c_check_header_compile \"$LINENO\" \"unistd.h\" \"ac_cv_header_unistd_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_unistd_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_UNISTD_H 1\" >>confdefs.h\n\nfi\nac_fn_c_check_header_compile \"$LINENO\" \"inttypes.h\" \"ac_cv_header_inttypes_h\" \"$ac_includes_default\"\nif test \"x$ac_cv_header_inttypes_h\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_INTTYPES_H 1\" >>confdefs.h\n\nfi\n\nac_fn_c_check_header_compile \"$LINENO\" \"libpq-fe.h\" \"ac_cv_header_libpq_fe_h\" \"/* dummy */\n\"\nif test \"x$ac_cv_header_libpq_fe_h\" = xyes\nthen :\n\nelse case e in #(\n  e) as_fn_error $? \"PostgreSQL header files not found\" \"$LINENO\" 5 ;;\nesac\nfi\n\n\n# Checks for typedefs, structures, and compiler characteristics.\n# Check whether --enable-largefile was given.\nif test ${enable_largefile+y}\nthen :\n  enableval=$enable_largefile;\nfi\nif test \"$enable_largefile,$enable_year2038\" != no,no\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support\" >&5\nprintf %s \"checking for $CC option to enable large file support... \" >&6; }\nif test ${ac_cv_sys_largefile_opts+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_save_CC=\"$CC\"\n  ac_opt_found=no\n  for ac_opt in \"none needed\" \"-D_FILE_OFFSET_BITS=64\" \"-D_LARGE_FILES=1\" \"-n32\"; do\n    if test x\"$ac_opt\" != x\"none needed\"\nthen :\n  CC=\"$ac_save_CC $ac_opt\"\nfi\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <sys/types.h>\n#ifndef FTYPE\n# define FTYPE off_t\n#endif\n /* Check that FTYPE can represent 2**63 - 1 correctly.\n    We can't simply define LARGE_FTYPE to be 9223372036854775807,\n    since some C++ compilers masquerading as C compilers\n    incorrectly reject 9223372036854775807.  */\n#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31))\n  int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721\n\t\t       && LARGE_FTYPE % 2147483647 == 1)\n\t\t      ? 1 : -1];\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  if test x\"$ac_opt\" = x\"none needed\"\nthen :\n  # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t.\n\t CC=\"$CC -DFTYPE=ino_t\"\n\t if ac_fn_c_try_compile \"$LINENO\"\nthen :\n\nelse case e in #(\n  e) CC=\"$CC -D_FILE_OFFSET_BITS=64\"\n\t    if ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_opt='-D_FILE_OFFSET_BITS=64'\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam\nfi\n      ac_cv_sys_largefile_opts=$ac_opt\n      ac_opt_found=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n    test $ac_opt_found = no || break\n  done\n  CC=\"$ac_save_CC\"\n\n  test $ac_opt_found = yes || ac_cv_sys_largefile_opts=\"support not detected\" ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts\" >&5\nprintf \"%s\\n\" \"$ac_cv_sys_largefile_opts\" >&6; }\n\nac_have_largefile=yes\ncase $ac_cv_sys_largefile_opts in #(\n  \"none needed\") :\n     ;; #(\n  \"supported through gnulib\") :\n     ;; #(\n  \"support not detected\") :\n    ac_have_largefile=no ;; #(\n  \"-D_FILE_OFFSET_BITS=64\") :\n\nprintf \"%s\\n\" \"#define _FILE_OFFSET_BITS 64\" >>confdefs.h\n ;; #(\n  \"-D_LARGE_FILES=1\") :\n\nprintf \"%s\\n\" \"#define _LARGE_FILES 1\" >>confdefs.h\n ;; #(\n  \"-n32\") :\n    CC=\"$CC -n32\" ;; #(\n  *) :\n    as_fn_error $? \"internal error: bad value for \\$ac_cv_sys_largefile_opts\" \"$LINENO\" 5 ;;\nesac\n\nif test \"$enable_year2038\" != no\nthen :\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038\" >&5\nprintf %s \"checking for $CC option for timestamps after 2038... \" >&6; }\nif test ${ac_cv_sys_year2038_opts+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_save_CPPFLAGS=\"$CPPFLAGS\"\n  ac_opt_found=no\n  for ac_opt in \"none needed\" \"-D_TIME_BITS=64\" \"-D__MINGW_USE_VC2005_COMPAT\" \"-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT\"; do\n    if test x\"$ac_opt\" != x\"none needed\"\nthen :\n  CPPFLAGS=\"$ac_save_CPPFLAGS $ac_opt\"\nfi\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n  #include <time.h>\n  /* Check that time_t can represent 2**32 - 1 correctly.  */\n  #define LARGE_TIME_T \\\\\n    ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30)))\n  int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535\n                           && LARGE_TIME_T % 65537 == 0)\n                          ? 1 : -1];\n\nint\nmain (void)\n{\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_sys_year2038_opts=\"$ac_opt\"\n      ac_opt_found=yes\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n    test $ac_opt_found = no || break\n  done\n  CPPFLAGS=\"$ac_save_CPPFLAGS\"\n  test $ac_opt_found = yes || ac_cv_sys_year2038_opts=\"support not detected\" ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts\" >&5\nprintf \"%s\\n\" \"$ac_cv_sys_year2038_opts\" >&6; }\n\nac_have_year2038=yes\ncase $ac_cv_sys_year2038_opts in #(\n  \"none needed\") :\n     ;; #(\n  \"support not detected\") :\n    ac_have_year2038=no ;; #(\n  \"-D_TIME_BITS=64\") :\n\nprintf \"%s\\n\" \"#define _TIME_BITS 64\" >>confdefs.h\n ;; #(\n  \"-D__MINGW_USE_VC2005_COMPAT\") :\n\nprintf \"%s\\n\" \"#define __MINGW_USE_VC2005_COMPAT 1\" >>confdefs.h\n ;; #(\n  \"-U_USE_32_BIT_TIME_T\"*) :\n    { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error $? \"the 'time_t' type is currently forced to be 32-bit. It\nwill stop working after mid-January 2038. Remove\n_USE_32BIT_TIME_T from the compiler flags.\nSee 'config.log' for more details\" \"$LINENO\" 5; } ;; #(\n  *) :\n    as_fn_error $? \"internal error: bad value for \\$ac_cv_sys_year2038_opts\" \"$LINENO\" 5 ;;\nesac\n\nfi\n\nfi\nac_fn_c_check_type \"$LINENO\" \"size_t\" \"ac_cv_type_size_t\" \"$ac_includes_default\"\nif test \"x$ac_cv_type_size_t\" = xyes\nthen :\n\nelse case e in #(\n  e)\nprintf \"%s\\n\" \"#define size_t unsigned int\" >>confdefs.h\n ;;\nesac\nfi\n\nac_fn_c_check_type \"$LINENO\" \"ssize_t\" \"ac_cv_type_ssize_t\" \"$ac_includes_default\"\nif test \"x$ac_cv_type_ssize_t\" = xyes\nthen :\n\nelse case e in #(\n  e)\nprintf \"%s\\n\" \"#define ssize_t int\" >>confdefs.h\n ;;\nesac\nfi\n\nac_fn_c_find_uintX_t \"$LINENO\" \"64\" \"ac_cv_c_uint64_t\"\ncase $ac_cv_c_uint64_t in #(\n  no|yes) ;; #(\n  *)\n\nprintf \"%s\\n\" \"#define _UINT64_T 1\" >>confdefs.h\n\n\nprintf \"%s\\n\" \"#define uint64_t $ac_cv_c_uint64_t\" >>confdefs.h\n;;\n  esac\n\nac_fn_c_find_uintX_t \"$LINENO\" \"32\" \"ac_cv_c_uint32_t\"\ncase $ac_cv_c_uint32_t in #(\n  no|yes) ;; #(\n  *)\n\nprintf \"%s\\n\" \"#define _UINT32_T 1\" >>confdefs.h\n\n\nprintf \"%s\\n\" \"#define uint32_t $ac_cv_c_uint32_t\" >>confdefs.h\n;;\n  esac\n\n# The cast to long int works around a bug in the HP C Compiler\n# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects\n# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'.\n# This bug is HP SR number 8606223364.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking size of unsigned int\" >&5\nprintf %s \"checking size of unsigned int... \" >&6; }\nif test ${ac_cv_sizeof_unsigned_int+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) if ac_fn_c_compute_int \"$LINENO\" \"(long int) (sizeof (unsigned int))\" \"ac_cv_sizeof_unsigned_int\"        \"$ac_includes_default\"\nthen :\n\nelse case e in #(\n  e) if test \"$ac_cv_type_unsigned_int\" = yes; then\n     { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error 77 \"cannot compute sizeof (unsigned int)\nSee 'config.log' for more details\" \"$LINENO\" 5; }\n   else\n     ac_cv_sizeof_unsigned_int=0\n   fi ;;\nesac\nfi\n ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int\" >&5\nprintf \"%s\\n\" \"$ac_cv_sizeof_unsigned_int\" >&6; }\n\n\n\nprintf \"%s\\n\" \"#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int\" >>confdefs.h\n\n\n# The cast to long int works around a bug in the HP C Compiler\n# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects\n# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'.\n# This bug is HP SR number 8606223364.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking size of unsigned long\" >&5\nprintf %s \"checking size of unsigned long... \" >&6; }\nif test ${ac_cv_sizeof_unsigned_long+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) if ac_fn_c_compute_int \"$LINENO\" \"(long int) (sizeof (unsigned long))\" \"ac_cv_sizeof_unsigned_long\"        \"$ac_includes_default\"\nthen :\n\nelse case e in #(\n  e) if test \"$ac_cv_type_unsigned_long\" = yes; then\n     { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error 77 \"cannot compute sizeof (unsigned long)\nSee 'config.log' for more details\" \"$LINENO\" 5; }\n   else\n     ac_cv_sizeof_unsigned_long=0\n   fi ;;\nesac\nfi\n ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long\" >&5\nprintf \"%s\\n\" \"$ac_cv_sizeof_unsigned_long\" >&6; }\n\n\n\nprintf \"%s\\n\" \"#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long\" >>confdefs.h\n\n\n# The cast to long int works around a bug in the HP C Compiler\n# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects\n# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'.\n# This bug is HP SR number 8606223364.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking size of unsigned short\" >&5\nprintf %s \"checking size of unsigned short... \" >&6; }\nif test ${ac_cv_sizeof_unsigned_short+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) if ac_fn_c_compute_int \"$LINENO\" \"(long int) (sizeof (unsigned short))\" \"ac_cv_sizeof_unsigned_short\"        \"$ac_includes_default\"\nthen :\n\nelse case e in #(\n  e) if test \"$ac_cv_type_unsigned_short\" = yes; then\n     { { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':\" >&5\nprintf \"%s\\n\" \"$as_me: error: in '$ac_pwd':\" >&2;}\nas_fn_error 77 \"cannot compute sizeof (unsigned short)\nSee 'config.log' for more details\" \"$LINENO\" 5; }\n   else\n     ac_cv_sizeof_unsigned_short=0\n   fi ;;\nesac\nfi\n ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short\" >&5\nprintf \"%s\\n\" \"$ac_cv_sizeof_unsigned_short\" >&6; }\n\n\n\nprintf \"%s\\n\" \"#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short\" >>confdefs.h\n\n\n { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian\" >&5\nprintf %s \"checking whether byte ordering is bigendian... \" >&6; }\nif test ${ac_cv_c_bigendian+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_cv_c_bigendian=unknown\n    # See if we're dealing with a universal compiler.\n    cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#ifndef __APPLE_CC__\n\t       not a universal capable compiler\n\t     #endif\n\t     typedef int dummy;\n\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n\n\t# Check for potential -arch flags.  It is not universal unless\n\t# there are at least two -arch flags with different values.\n\tac_arch=\n\tac_prev=\n\tfor ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do\n\t if test -n \"$ac_prev\"; then\n\t   case $ac_word in\n\t     i?86 | x86_64 | ppc | ppc64)\n\t       if test -z \"$ac_arch\" || test \"$ac_arch\" = \"$ac_word\"; then\n\t\t ac_arch=$ac_word\n\t       else\n\t\t ac_cv_c_bigendian=universal\n\t\t break\n\t       fi\n\t       ;;\n\t   esac\n\t   ac_prev=\n\t elif test \"x$ac_word\" = \"x-arch\"; then\n\t   ac_prev=arch\n\t fi\n       done\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n    if test $ac_cv_c_bigendian = unknown; then\n      # See if sys/param.h defines the BYTE_ORDER macro.\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <sys/types.h>\n\t     #include <sys/param.h>\n\nint\nmain (void)\n{\n#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\\\\n\t\t     && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\\\\n\t\t     && LITTLE_ENDIAN)\n\t      bogus endian macros\n\t     #endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  # It does; now see whether it defined to BIG_ENDIAN or not.\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <sys/types.h>\n\t\t#include <sys/param.h>\n\nint\nmain (void)\n{\n#if BYTE_ORDER != BIG_ENDIAN\n\t\t not big endian\n\t\t#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_c_bigendian=yes\nelse case e in #(\n  e) ac_cv_c_bigendian=no ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n    fi\n    if test $ac_cv_c_bigendian = unknown; then\n      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).\n      cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <limits.h>\n\nint\nmain (void)\n{\n#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)\n\t      bogus endian macros\n\t     #endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  # It does; now see whether it defined to _BIG_ENDIAN or not.\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n#include <limits.h>\n\nint\nmain (void)\n{\n#ifndef _BIG_ENDIAN\n\t\t not big endian\n\t\t#endif\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_compile \"$LINENO\"\nthen :\n  ac_cv_c_bigendian=yes\nelse case e in #(\n  e) ac_cv_c_bigendian=no ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext\n    fi\n    if test $ac_cv_c_bigendian = unknown; then\n      # Compile a test program.\n      if test \"$cross_compiling\" = yes\nthen :\n  # Try to guess by grepping values from an object file.\n\t cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\nunsigned short int ascii_mm[] =\n\t\t  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };\n\t\tunsigned short int ascii_ii[] =\n\t\t  { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };\n\t\tint use_ascii (int i) {\n\t\t  return ascii_mm[i] + ascii_ii[i];\n\t\t}\n\t\tunsigned short int ebcdic_ii[] =\n\t\t  { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };\n\t\tunsigned short int ebcdic_mm[] =\n\t\t  { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };\n\t\tint use_ebcdic (int i) {\n\t\t  return ebcdic_mm[i] + ebcdic_ii[i];\n\t\t}\n\t\tint\n\t\tmain (int argc, char **argv)\n\t\t{\n\t\t  /* Intimidate the compiler so that it does not\n\t\t     optimize the arrays away.  */\n\t\t  char *p = argv[0];\n\t\t  ascii_mm[1] = *p++; ebcdic_mm[1] = *p++;\n\t\t  ascii_ii[1] = *p++; ebcdic_ii[1] = *p++;\n\t\t  return use_ascii (argc) == use_ebcdic (*p);\n\t\t}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"\nthen :\n  if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then\n\t      ac_cv_c_bigendian=yes\n\t    fi\n\t    if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then\n\t      if test \"$ac_cv_c_bigendian\" = unknown; then\n\t\tac_cv_c_bigendian=no\n\t      else\n\t\t# finding both strings is unlikely to happen, but who knows?\n\t\tac_cv_c_bigendian=unknown\n\t      fi\n\t    fi\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam \\\n    conftest$ac_exeext conftest.$ac_ext\nelse case e in #(\n  e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n$ac_includes_default\nint\nmain (void)\n{\n\n\t     /* Are we little or big endian?  From Harbison&Steele.  */\n\t     union\n\t     {\n\t       long int l;\n\t       char c[sizeof (long int)];\n\t     } u;\n\t     u.l = 1;\n\t     return u.c[sizeof (long int) - 1] == 1;\n\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"\nthen :\n  ac_cv_c_bigendian=no\nelse case e in #(\n  e) ac_cv_c_bigendian=yes ;;\nesac\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext ;;\nesac\nfi\n\n    fi ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian\" >&5\nprintf \"%s\\n\" \"$ac_cv_c_bigendian\" >&6; }\n case $ac_cv_c_bigendian in #(\n   yes)\n     printf \"%s\\n\" \"#define WORDS_BIGENDIAN 1\" >>confdefs.h\n;; #(\n   no)\n      ;; #(\n   universal)\n\nprintf \"%s\\n\" \"#define AC_APPLE_UNIVERSAL_BUILD 1\" >>confdefs.h\n\n     ;; #(\n   *)\n     as_fn_error $? \"unknown endianness\n presetting ac_cv_c_bigendian=no (or yes) will help\" \"$LINENO\" 5 ;;\n esac\n\n\n# Checks for library functions.\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for working strtod\" >&5\nprintf %s \"checking for working strtod... \" >&6; }\nif test ${ac_cv_func_strtod+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) if test \"$cross_compiling\" = yes\nthen :\n  ac_cv_func_strtod=no\nelse case e in #(\n  e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n$ac_includes_default\nint\nmain (void)\n{\n  {\n    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */\n    char *string = \" +69\";\n    char *term;\n    double value;\n    value = strtod (string, &term);\n    if (value != 69 || term != (string + 4))\n      return 1;\n  }\n\n  {\n    /* Under Solaris 2.4, strtod returns the wrong value for the\n       terminating character under some conditions.  */\n    char *string = \"NaN\";\n    char *term;\n    strtod (string, &term);\n    if (term != string && *(term - 1) == 0)\n      return 1;\n  }\n  return 0;\n}\n\n_ACEOF\nif ac_fn_c_try_run \"$LINENO\"\nthen :\n  ac_cv_func_strtod=yes\nelse case e in #(\n  e) ac_cv_func_strtod=no ;;\nesac\nfi\nrm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \\\n  conftest.$ac_objext conftest.beam conftest.$ac_ext ;;\nesac\nfi\n ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod\" >&5\nprintf \"%s\\n\" \"$ac_cv_func_strtod\" >&6; }\nif test $ac_cv_func_strtod = no; then\n  case \" $LIBOBJS \" in\n  *\" strtod.$ac_objext \"* ) ;;\n  *) LIBOBJS=\"$LIBOBJS strtod.$ac_objext\"\n ;;\nesac\n\nac_fn_c_check_func \"$LINENO\" \"pow\" \"ac_cv_func_pow\"\nif test \"x$ac_cv_func_pow\" = xyes\nthen :\n\nfi\n\nif test $ac_cv_func_pow = no; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: checking for pow in -lm\" >&5\nprintf %s \"checking for pow in -lm... \" >&6; }\nif test ${ac_cv_lib_m_pow+y}\nthen :\n  printf %s \"(cached) \" >&6\nelse case e in #(\n  e) ac_check_lib_save_LIBS=$LIBS\nLIBS=\"-lm  $LIBS\"\ncat confdefs.h - <<_ACEOF >conftest.$ac_ext\n/* end confdefs.h.  */\n\n/* Override any GCC internal prototype to avoid an error.\n   Use char because int might match the return type of a GCC\n   builtin and then its argument prototype would still apply.\n   The 'extern \"C\"' is for builds by C++ compilers;\n   although this is not generally supported in C code supporting it here\n   has little cost and some practical benefit (sr 110532).  */\n#ifdef __cplusplus\nextern \"C\"\n#endif\nchar pow (void);\nint\nmain (void)\n{\nreturn pow ();\n  ;\n  return 0;\n}\n_ACEOF\nif ac_fn_c_try_link \"$LINENO\"\nthen :\n  ac_cv_lib_m_pow=yes\nelse case e in #(\n  e) ac_cv_lib_m_pow=no ;;\nesac\nfi\nrm -f core conftest.err conftest.$ac_objext conftest.beam \\\n    conftest$ac_exeext conftest.$ac_ext\nLIBS=$ac_check_lib_save_LIBS ;;\nesac\nfi\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow\" >&5\nprintf \"%s\\n\" \"$ac_cv_lib_m_pow\" >&6; }\nif test \"x$ac_cv_lib_m_pow\" = xyes\nthen :\n  POW_LIB=-lm\nelse case e in #(\n  e) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: cannot find library containing definition of pow\" >&2;} ;;\nesac\nfi\n\nfi\n\nfi\n\nac_fn_c_check_func \"$LINENO\" \"gettimeofday\" \"ac_cv_func_gettimeofday\"\nif test \"x$ac_cv_func_gettimeofday\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_GETTIMEOFDAY 1\" >>confdefs.h\n\nfi\nac_fn_c_check_func \"$LINENO\" \"select\" \"ac_cv_func_select\"\nif test \"x$ac_cv_func_select\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_SELECT 1\" >>confdefs.h\n\nfi\nac_fn_c_check_func \"$LINENO\" \"setenv\" \"ac_cv_func_setenv\"\nif test \"x$ac_cv_func_setenv\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_SETENV 1\" >>confdefs.h\n\nfi\nac_fn_c_check_func \"$LINENO\" \"strchr\" \"ac_cv_func_strchr\"\nif test \"x$ac_cv_func_strchr\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_STRCHR 1\" >>confdefs.h\n\nfi\nac_fn_c_check_func \"$LINENO\" \"strtoul\" \"ac_cv_func_strtoul\"\nif test \"x$ac_cv_func_strtoul\" = xyes\nthen :\n  printf \"%s\\n\" \"#define HAVE_STRTOUL 1\" >>confdefs.h\n\nfi\n\n\nac_config_files=\"$ac_config_files Makefile test/runtest.sh\"\n\ncat >confcache <<\\_ACEOF\n# This file is a shell script that caches the results of configure\n# tests run on this system so they can be shared between configure\n# scripts and configure runs, see configure's option --config-cache.\n# It is not useful on other systems.  If it contains results you don't\n# want to keep, you may remove or edit it.\n#\n# config.status only pays attention to the cache file if you give it\n# the --recheck option to rerun configure.\n#\n# 'ac_cv_env_foo' variables (set or unset) will be overridden when\n# loading this file, other *unset* 'ac_cv_foo' will be assigned the\n# following values.\n\n_ACEOF\n\n# The following way of writing the cache mishandles newlines in values,\n# but we know of no workaround that is simple, portable, and efficient.\n# So, we kill variables containing newlines.\n# Ultrix sh set writes to stderr and can't be redirected directly,\n# and sets the high bit in the cache file unless we assign to the vars.\n(\n  for ac_var in `(set) 2>&1 | sed -n 's/^\\([a-zA-Z_][a-zA-Z0-9_]*\\)=.*/\\1/p'`; do\n    eval ac_val=\\$$ac_var\n    case $ac_val in #(\n    *${as_nl}*)\n      case $ac_var in #(\n      *_cv_*) { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: cache variable $ac_var contains a newline\" >&2;} ;;\n      esac\n      case $ac_var in #(\n      _ | IFS | as_nl) ;; #(\n      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(\n      *) { eval $ac_var=; unset $ac_var;} ;;\n      esac ;;\n    esac\n  done\n\n  (set) 2>&1 |\n    case $as_nl`(ac_space=' '; set) 2>&1` in #(\n    *${as_nl}ac_space=\\ *)\n      # 'set' does not quote correctly, so add quotes: double-quote\n      # substitution turns \\\\\\\\ into \\\\, and sed turns \\\\ into \\.\n      sed -n \\\n\t\"s/'/'\\\\\\\\''/g;\n\t  s/^\\\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\\\)=\\\\(.*\\\\)/\\\\1='\\\\2'/p\"\n      ;; #(\n    *)\n      # 'set' quotes correctly as required by POSIX, so do not add quotes.\n      sed -n \"/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p\"\n      ;;\n    esac |\n    sort\n) |\n  sed '\n     /^ac_cv_env_/b end\n     t clear\n     :clear\n     s/^\\([^=]*\\)=\\(.*[{}].*\\)$/test ${\\1+y} || &/\n     t end\n     s/^\\([^=]*\\)=\\(.*\\)$/\\1=${\\1=\\2}/\n     :end' >>confcache\nif diff \"$cache_file\" confcache >/dev/null 2>&1; then :; else\n  if test -w \"$cache_file\"; then\n    if test \"x$cache_file\" != \"x/dev/null\"; then\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: updating cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: updating cache $cache_file\" >&6;}\n      if test ! -f \"$cache_file\" || test -h \"$cache_file\"; then\n\tcat confcache >\"$cache_file\"\n      else\n        case $cache_file in #(\n        */* | ?:*)\n\t  mv -f confcache \"$cache_file\"$$ &&\n\t  mv -f \"$cache_file\"$$ \"$cache_file\" ;; #(\n        *)\n\t  mv -f confcache \"$cache_file\" ;;\n\tesac\n      fi\n    fi\n  else\n    { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file\" >&5\nprintf \"%s\\n\" \"$as_me: not updating unwritable cache $cache_file\" >&6;}\n  fi\nfi\nrm -f confcache\n\ntest \"x$prefix\" = xNONE && prefix=$ac_default_prefix\n# Let make expand exec_prefix.\ntest \"x$exec_prefix\" = xNONE && exec_prefix='${prefix}'\n\nDEFS=-DHAVE_CONFIG_H\n\nac_libobjs=\nac_ltlibobjs=\nU=\nfor ac_i in : $LIBOBJS; do test \"x$ac_i\" = x: && continue\n  # 1. Remove the extension, and $U if already installed.\n  ac_script='s/\\$U\\././;s/\\.o$//;s/\\.obj$//'\n  ac_i=`printf \"%s\\n\" \"$ac_i\" | sed \"$ac_script\"`\n  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR\n  #    will be set to the directory where LIBOBJS objects are built.\n  as_fn_append ac_libobjs \" \\${LIBOBJDIR}$ac_i\\$U.$ac_objext\"\n  as_fn_append ac_ltlibobjs \" \\${LIBOBJDIR}$ac_i\"'$U.lo'\ndone\nLIBOBJS=$ac_libobjs\n\nLTLIBOBJS=$ac_ltlibobjs\n\n\n# Check whether --enable-year2038 was given.\nif test ${enable_year2038+y}\nthen :\n  enableval=$enable_year2038;\nfi\n\n\n\n: \"${CONFIG_STATUS=./config.status}\"\nac_write_fail=0\nac_clean_files_save=$ac_clean_files\nac_clean_files=\"$ac_clean_files $CONFIG_STATUS\"\n{ printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS\" >&5\nprintf \"%s\\n\" \"$as_me: creating $CONFIG_STATUS\" >&6;}\nas_write_fail=0\ncat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1\n#! $SHELL\n# Generated by $as_me.\n# Run this file to recreate the current configuration.\n# Compiler output produced by configure, useful for debugging\n# configure, is in config.log if it exists.\n\ndebug=false\nac_cs_recheck=false\nac_cs_silent=false\n\nSHELL=\\${CONFIG_SHELL-$SHELL}\nexport SHELL\n_ASEOF\ncat >>$CONFIG_STATUS <<\\_ASEOF || as_write_fail=1\n## -------------------- ##\n## M4sh Initialization. ##\n## -------------------- ##\n\n# Be more Bourne compatible\nDUALCASE=1; export DUALCASE # for MKS sh\nif test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1\nthen :\n  emulate sh\n  NULLCMD=:\n  # Pre-4.2 versions of Zsh do word splitting on ${1+\"$@\"}, which\n  # is contrary to our usage.  Disable this feature.\n  alias -g '${1+\"$@\"}'='\"$@\"'\n  setopt NO_GLOB_SUBST\nelse case e in #(\n  e) case `(set -o) 2>/dev/null` in #(\n  *posix*) :\n    set -o posix ;; #(\n  *) :\n     ;;\nesac ;;\nesac\nfi\n\n\n\n# Reset variables that may have inherited troublesome values from\n# the environment.\n\n# IFS needs to be set, to space, tab, and newline, in precisely that order.\n# (If _AS_PATH_WALK were called with IFS unset, it would have the\n# side effect of setting IFS to empty, thus disabling word splitting.)\n# Quoting is to prevent editors from complaining about space-tab.\nas_nl='\n'\nexport as_nl\nIFS=\" \"\"\t$as_nl\"\n\nPS1='$ '\nPS2='> '\nPS4='+ '\n\n# Ensure predictable behavior from utilities with locale-dependent output.\nLC_ALL=C\nexport LC_ALL\nLANGUAGE=C\nexport LANGUAGE\n\n# We cannot yet rely on \"unset\" to work, but we need these variables\n# to be unset--not just set to an empty or harmless value--now, to\n# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct\n# also avoids known problems related to \"unset\" and subshell syntax\n# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).\nfor as_var in BASH_ENV ENV MAIL MAILPATH CDPATH\ndo eval test \\${$as_var+y} \\\n  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\ndone\n\n# Ensure that fds 0, 1, and 2 are open.\nif (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi\nif (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi\nif (exec 3>&2)            ; then :; else exec 2>/dev/null; fi\n\n# The user is always right.\nif ${PATH_SEPARATOR+false} :; then\n  PATH_SEPARATOR=:\n  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n      PATH_SEPARATOR=';'\n  }\nfi\n\n\n# Find who we are.  Look in the path if we contain no directory separator.\nas_myself=\ncase $0 in #((\n  *[\\\\/]* ) as_myself=$0 ;;\n  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\nfor as_dir in $PATH\ndo\n  IFS=$as_save_IFS\n  case $as_dir in #(((\n    '') as_dir=./ ;;\n    */) ;;\n    *) as_dir=$as_dir/ ;;\n  esac\n    test -r \"$as_dir$0\" && as_myself=$as_dir$0 && break\n  done\nIFS=$as_save_IFS\n\n     ;;\nesac\n# We did not find ourselves, most probably we were run as 'sh COMMAND'\n# in which case we are not to be found in the path.\nif test \"x$as_myself\" = x; then\n  as_myself=$0\nfi\nif test ! -f \"$as_myself\"; then\n  printf \"%s\\n\" \"$as_myself: error: cannot find myself; rerun with an absolute file name\" >&2\n  exit 1\nfi\n\n\n\n# as_fn_error STATUS ERROR [LINENO LOG_FD]\n# ----------------------------------------\n# Output \"`basename $0`: error: ERROR\" to stderr. If LINENO and LOG_FD are\n# provided, also output the error to LOG_FD, referencing LINENO. Then exit the\n# script with STATUS, using 1 if that was 0.\nas_fn_error ()\n{\n  as_status=$1; test $as_status -eq 0 && as_status=1\n  if test \"$4\"; then\n    as_lineno=${as_lineno-\"$3\"} as_lineno_stack=as_lineno_stack=$as_lineno_stack\n    printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: error: $2\" >&$4\n  fi\n  printf \"%s\\n\" \"$as_me: error: $2\" >&2\n  as_fn_exit $as_status\n} # as_fn_error\n\n\n# as_fn_set_status STATUS\n# -----------------------\n# Set $? to STATUS, without forking.\nas_fn_set_status ()\n{\n  return $1\n} # as_fn_set_status\n\n# as_fn_exit STATUS\n# -----------------\n# Exit the shell with STATUS, even in a \"trap 0\" or \"set -e\" context.\nas_fn_exit ()\n{\n  set +e\n  as_fn_set_status $1\n  exit $1\n} # as_fn_exit\n\n# as_fn_unset VAR\n# ---------------\n# Portably unset VAR.\nas_fn_unset ()\n{\n  { eval $1=; unset $1;}\n}\nas_unset=as_fn_unset\n\n# as_fn_append VAR VALUE\n# ----------------------\n# Append the text in VALUE to the end of the definition contained in VAR. Take\n# advantage of any shell optimizations that allow amortized linear growth over\n# repeated appends, instead of the typical quadratic growth present in naive\n# implementations.\nif (eval \"as_var=1; as_var+=2; test x\\$as_var = x12\") 2>/dev/null\nthen :\n  eval 'as_fn_append ()\n  {\n    eval $1+=\\$2\n  }'\nelse case e in #(\n  e) as_fn_append ()\n  {\n    eval $1=\\$$1\\$2\n  } ;;\nesac\nfi # as_fn_append\n\n# as_fn_arith ARG...\n# ------------------\n# Perform arithmetic evaluation on the ARGs, and store the result in the\n# global $as_val. Take advantage of shells that can avoid forks. The arguments\n# must be portable across $(()) and expr.\nif (eval \"test \\$(( 1 + 1 )) = 2\") 2>/dev/null\nthen :\n  eval 'as_fn_arith ()\n  {\n    as_val=$(( $* ))\n  }'\nelse case e in #(\n  e) as_fn_arith ()\n  {\n    as_val=`expr \"$@\" || test $? -eq 1`\n  } ;;\nesac\nfi # as_fn_arith\n\n\nif expr a : '\\(a\\)' >/dev/null 2>&1 &&\n   test \"X`expr 00001 : '.*\\(...\\)'`\" = X001; then\n  as_expr=expr\nelse\n  as_expr=false\nfi\n\nif (basename -- /) >/dev/null 2>&1 && test \"X`basename -- / 2>&1`\" = \"X/\"; then\n  as_basename=basename\nelse\n  as_basename=false\nfi\n\nif (as_dir=`dirname -- /` && test \"X$as_dir\" = X/) >/dev/null 2>&1; then\n  as_dirname=dirname\nelse\n  as_dirname=false\nfi\n\nas_me=`$as_basename -- \"$0\" ||\n$as_expr X/\"$0\" : '.*/\\([^/][^/]*\\)/*$' \\| \\\n\t X\"$0\" : 'X\\(//\\)$' \\| \\\n\t X\"$0\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X/\"$0\" |\n    sed '/^.*\\/\\([^/][^/]*\\)\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\/\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n\n# Avoid depending upon Character Ranges.\nas_cr_letters='abcdefghijklmnopqrstuvwxyz'\nas_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'\nas_cr_Letters=$as_cr_letters$as_cr_LETTERS\nas_cr_digits='0123456789'\nas_cr_alnum=$as_cr_Letters$as_cr_digits\n\n\n# Determine whether it's possible to make 'echo' print without a newline.\n# These variables are no longer used directly by Autoconf, but are AC_SUBSTed\n# for compatibility with existing Makefiles.\nECHO_C= ECHO_N= ECHO_T=\ncase `echo -n x` in #(((((\n-n*)\n  case `echo 'xy\\c'` in\n  *c*) ECHO_T='\t';;\t# ECHO_T is single tab character.\n  xy)  ECHO_C='\\c';;\n  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null\n       ECHO_T='\t';;\n  esac;;\n*)\n  ECHO_N='-n';;\nesac\n\n# For backward compatibility with old third-party macros, we provide\n# the shell variables $as_echo and $as_echo_n.  New code should use\n# AS_ECHO([\"message\"]) and AS_ECHO_N([\"message\"]), respectively.\nas_echo='printf %s\\n'\nas_echo_n='printf %s'\n\nrm -f conf$$ conf$$.exe conf$$.file\nif test -d conf$$.dir; then\n  rm -f conf$$.dir/conf$$.file\nelse\n  rm -f conf$$.dir\n  mkdir conf$$.dir 2>/dev/null\nfi\nif (echo >conf$$.file) 2>/dev/null; then\n  if ln -s conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s='ln -s'\n    # ... but there are two gotchas:\n    # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail.\n    # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable.\n    # In both cases, we have to default to 'cp -pR'.\n    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||\n      as_ln_s='cp -pR'\n  elif ln conf$$.file conf$$ 2>/dev/null; then\n    as_ln_s=ln\n  else\n    as_ln_s='cp -pR'\n  fi\nelse\n  as_ln_s='cp -pR'\nfi\nrm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file\nrmdir conf$$.dir 2>/dev/null\n\n\n# as_fn_mkdir_p\n# -------------\n# Create \"$as_dir\" as a directory, including parents if necessary.\nas_fn_mkdir_p ()\n{\n\n  case $as_dir in #(\n  -*) as_dir=./$as_dir;;\n  esac\n  test -d \"$as_dir\" || eval $as_mkdir_p || {\n    as_dirs=\n    while :; do\n      case $as_dir in #(\n      *\\'*) as_qdir=`printf \"%s\\n\" \"$as_dir\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; #'(\n      *) as_qdir=$as_dir;;\n      esac\n      as_dirs=\"'$as_qdir' $as_dirs\"\n      as_dir=`$as_dirname -- \"$as_dir\" ||\n$as_expr X\"$as_dir\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$as_dir\" : 'X\\(//\\)$' \\| \\\n\t X\"$as_dir\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$as_dir\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n      test -d \"$as_dir\" && break\n    done\n    test -z \"$as_dirs\" || eval \"mkdir $as_dirs\"\n  } || test -d \"$as_dir\" || as_fn_error $? \"cannot create directory $as_dir\"\n\n\n} # as_fn_mkdir_p\nif mkdir -p . 2>/dev/null; then\n  as_mkdir_p='mkdir -p \"$as_dir\"'\nelse\n  test -d ./-p && rmdir ./-p\n  as_mkdir_p=false\nfi\n\n\n# as_fn_executable_p FILE\n# -----------------------\n# Test if FILE is an executable regular file.\nas_fn_executable_p ()\n{\n  test -f \"$1\" && test -x \"$1\"\n} # as_fn_executable_p\nas_test_x='test -x'\nas_executable_p=as_fn_executable_p\n\n# Sed expression to map a string onto a valid CPP name.\nas_sed_cpp=\"y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g\"\nas_tr_cpp=\"eval sed '$as_sed_cpp'\" # deprecated\n\n# Sed expression to map a string onto a valid variable name.\nas_sed_sh=\"y%*+%pp%;s%[^_$as_cr_alnum]%_%g\"\nas_tr_sh=\"eval sed '$as_sed_sh'\" # deprecated\n\n\nexec 6>&1\n## ----------------------------------- ##\n## Main body of $CONFIG_STATUS script. ##\n## ----------------------------------- ##\n_ASEOF\ntest $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# Save the log message, to keep $0 and so on meaningful, and to\n# report actual input values of CONFIG_FILES etc. instead of their\n# values after options handling.\nac_log=\"\nThis file was extended by pgreplay $as_me 1.5.0, which was\ngenerated by GNU Autoconf 2.72.  Invocation command line was\n\n  CONFIG_FILES    = $CONFIG_FILES\n  CONFIG_HEADERS  = $CONFIG_HEADERS\n  CONFIG_LINKS    = $CONFIG_LINKS\n  CONFIG_COMMANDS = $CONFIG_COMMANDS\n  $ $0 $@\n\non `(hostname || uname -n) 2>/dev/null | sed 1q`\n\"\n\n_ACEOF\n\ncase $ac_config_files in *\"\n\"*) set x $ac_config_files; shift; ac_config_files=$*;;\nesac\n\ncase $ac_config_headers in *\"\n\"*) set x $ac_config_headers; shift; ac_config_headers=$*;;\nesac\n\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n# Files that config.status was made for.\nconfig_files=\"$ac_config_files\"\nconfig_headers=\"$ac_config_headers\"\n\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nac_cs_usage=\"\\\n'$as_me' instantiates files and other configuration actions\nfrom templates according to the current configuration.  Unless the files\nand actions are specified as TAGs, all are instantiated by default.\n\nUsage: $0 [OPTION]... [TAG]...\n\n  -h, --help       print this help, then exit\n  -V, --version    print version number and configuration settings, then exit\n      --config     print configuration, then exit\n  -q, --quiet, --silent\n                   do not print progress messages\n  -d, --debug      don't remove temporary files\n      --recheck    update $as_me by reconfiguring in the same conditions\n      --file=FILE[:TEMPLATE]\n                   instantiate the configuration file FILE\n      --header=FILE[:TEMPLATE]\n                   instantiate the configuration header FILE\n\nConfiguration files:\n$config_files\n\nConfiguration headers:\n$config_headers\n\nReport bugs to <https://github.com/laurenz/pgreplay/issues>.\npgreplay home page: <http://laurenz.github.io/pgreplay/>.\"\n\n_ACEOF\nac_cs_config=`printf \"%s\\n\" \"$ac_configure_args\" | sed \"$ac_safe_unquote\"`\nac_cs_config_escaped=`printf \"%s\\n\" \"$ac_cs_config\" | sed \"s/^ //; s/'/'\\\\\\\\\\\\\\\\''/g\"`\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_cs_config='$ac_cs_config_escaped'\nac_cs_version=\"\\\\\npgreplay config.status 1.5.0\nconfigured by $0, generated by GNU Autoconf 2.72,\n  with options \\\\\"\\$ac_cs_config\\\\\"\n\nCopyright (C) 2023 Free Software Foundation, Inc.\nThis config.status script is free software; the Free Software Foundation\ngives unlimited permission to copy, distribute and modify it.\"\n\nac_pwd='$ac_pwd'\nsrcdir='$srcdir'\nINSTALL='$INSTALL'\ntest -n \"\\$AWK\" || AWK=awk\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# The default lists apply if the user does not specify any file.\nac_need_defaults=:\nwhile test $# != 0\ndo\n  case $1 in\n  --*=?*)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=`expr \"X$1\" : 'X[^=]*=\\(.*\\)'`\n    ac_shift=:\n    ;;\n  --*=)\n    ac_option=`expr \"X$1\" : 'X\\([^=]*\\)='`\n    ac_optarg=\n    ac_shift=:\n    ;;\n  *)\n    ac_option=$1\n    ac_optarg=$2\n    ac_shift=shift\n    ;;\n  esac\n\n  case $ac_option in\n  # Handling of the options.\n  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)\n    ac_cs_recheck=: ;;\n  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )\n    printf \"%s\\n\" \"$ac_cs_version\"; exit ;;\n  --config | --confi | --conf | --con | --co | --c )\n    printf \"%s\\n\" \"$ac_cs_config\"; exit ;;\n  --debug | --debu | --deb | --de | --d | -d )\n    debug=: ;;\n  --file | --fil | --fi | --f )\n    $ac_shift\n    case $ac_optarg in\n    *\\'*) ac_optarg=`printf \"%s\\n\" \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    '') as_fn_error $? \"missing file argument\" ;;\n    esac\n    as_fn_append CONFIG_FILES \" '$ac_optarg'\"\n    ac_need_defaults=false;;\n  --header | --heade | --head | --hea )\n    $ac_shift\n    case $ac_optarg in\n    *\\'*) ac_optarg=`printf \"%s\\n\" \"$ac_optarg\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"` ;;\n    esac\n    as_fn_append CONFIG_HEADERS \" '$ac_optarg'\"\n    ac_need_defaults=false;;\n  --he | --h)\n    # Conflict between --help and --header\n    as_fn_error $? \"ambiguous option: '$1'\nTry '$0 --help' for more information.\";;\n  --help | --hel | -h )\n    printf \"%s\\n\" \"$ac_cs_usage\"; exit ;;\n  -q | -quiet | --quiet | --quie | --qui | --qu | --q \\\n  | -silent | --silent | --silen | --sile | --sil | --si | --s)\n    ac_cs_silent=: ;;\n\n  # This is an error.\n  -*) as_fn_error $? \"unrecognized option: '$1'\nTry '$0 --help' for more information.\" ;;\n\n  *) as_fn_append ac_config_targets \" $1\"\n     ac_need_defaults=false ;;\n\n  esac\n  shift\ndone\n\nac_configure_extra_args=\n\nif $ac_cs_silent; then\n  exec 6>/dev/null\n  ac_configure_extra_args=\"$ac_configure_extra_args --silent\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nif \\$ac_cs_recheck; then\n  set X $SHELL '$0' $ac_configure_args \\$ac_configure_extra_args --no-create --no-recursion\n  shift\n  \\printf \"%s\\n\" \"running CONFIG_SHELL=$SHELL \\$*\" >&6\n  CONFIG_SHELL='$SHELL'\n  export CONFIG_SHELL\n  exec \"\\$@\"\nfi\n\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nexec 5>>config.log\n{\n  echo\n  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX\n## Running $as_me. ##\n_ASBOX\n  printf \"%s\\n\" \"$ac_log\"\n} >&5\n\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n\n# Handling of arguments.\nfor ac_config_target in $ac_config_targets\ndo\n  case $ac_config_target in\n    \"config.h\") CONFIG_HEADERS=\"$CONFIG_HEADERS config.h\" ;;\n    \"Makefile\") CONFIG_FILES=\"$CONFIG_FILES Makefile\" ;;\n    \"test/runtest.sh\") CONFIG_FILES=\"$CONFIG_FILES test/runtest.sh\" ;;\n\n  *) as_fn_error $? \"invalid argument: '$ac_config_target'\" \"$LINENO\" 5;;\n  esac\ndone\n\n\n# If the user did not use the arguments to specify the items to instantiate,\n# then the envvar interface is used.  Set only those that are not.\n# We use the long form for the default assignment because of an extremely\n# bizarre bug on SunOS 4.1.3.\nif $ac_need_defaults; then\n  test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files\n  test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers\nfi\n\n# Have a temporary directory for convenience.  Make it in the build tree\n# simply because there is no reason against having it here, and in addition,\n# creating and moving files from /tmp can sometimes cause problems.\n# Hook for its removal unless debugging.\n# Note that there is a small window in which the directory will not be cleaned:\n# after its creation but before its name has been assigned to '$tmp'.\n$debug ||\n{\n  tmp= ac_tmp=\n  trap 'exit_status=$?\n  : \"${ac_tmp:=$tmp}\"\n  { test ! -d \"$ac_tmp\" || rm -fr \"$ac_tmp\"; } && exit $exit_status\n' 0\n  trap 'as_fn_exit 1' 1 2 13 15\n}\n# Create a (secure) tmp directory for tmp files.\n\n{\n  tmp=`(umask 077 && mktemp -d \"./confXXXXXX\") 2>/dev/null` &&\n  test -d \"$tmp\"\n}  ||\n{\n  tmp=./conf$$-$RANDOM\n  (umask 077 && mkdir \"$tmp\")\n} || as_fn_error $? \"cannot create a temporary directory in .\" \"$LINENO\" 5\nac_tmp=$tmp\n\n# Set up the scripts for CONFIG_FILES section.\n# No need to generate them if there are no CONFIG_FILES.\n# This happens for instance with './config.status config.h'.\nif test -n \"$CONFIG_FILES\"; then\n\n\nac_cr=`echo X | tr X '\\015'`\n# On cygwin, bash can eat \\r inside `` if the user requested igncr.\n# But we know of no other shell where ac_cr would be empty at this\n# point, so we can use a bashism as a fallback.\nif test \"x$ac_cr\" = x; then\n  eval ac_cr=\\$\\'\\\\r\\'\nfi\nac_cs_awk_cr=`$AWK 'BEGIN { print \"a\\rb\" }' </dev/null 2>/dev/null`\nif test \"$ac_cs_awk_cr\" = \"a${ac_cr}b\"; then\n  ac_cs_awk_cr='\\\\r'\nelse\n  ac_cs_awk_cr=$ac_cr\nfi\n\necho 'BEGIN {' >\"$ac_tmp/subs1.awk\" &&\n_ACEOF\n\n\n{\n  echo \"cat >conf$$subs.awk <<_ACEOF\" &&\n  echo \"$ac_subst_vars\" | sed 's/.*/&!$&$ac_delim/' &&\n  echo \"_ACEOF\"\n} >conf$$subs.sh ||\n  as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\nac_delim_num=`echo \"$ac_subst_vars\" | grep -c '^'`\nac_delim='%!_!# '\nfor ac_last_try in false false false false false :; do\n  . ./conf$$subs.sh ||\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n\n  ac_delim_n=`sed -n \"s/.*$ac_delim\\$/X/p\" conf$$subs.awk | grep -c X`\n  if test $ac_delim_n = $ac_delim_num; then\n    break\n  elif $ac_last_try; then\n    as_fn_error $? \"could not make $CONFIG_STATUS\" \"$LINENO\" 5\n  else\n    ac_delim=\"$ac_delim!$ac_delim _$ac_delim!! \"\n  fi\ndone\nrm -f conf$$subs.sh\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\ncat >>\"\\$ac_tmp/subs1.awk\" <<\\\\_ACAWK &&\n_ACEOF\nsed -n '\nh\ns/^/S[\"/; s/!.*/\"]=/\np\ng\ns/^[^!]*!//\n:repl\nt repl\ns/'\"$ac_delim\"'$//\nt delim\n:nl\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\\\\n\"\\\\/\np\nn\nb repl\n:more1\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt nl\n:delim\nh\ns/\\(.\\{148\\}\\)..*/\\1/\nt more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"/\np\nb\n:more2\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"\\\\/\np\ng\ns/.\\{148\\}//\nt delim\n' <conf$$subs.awk | sed '\n/^[^\"\"]/{\n  N\n  s/\\n//\n}\n' >>$CONFIG_STATUS || ac_write_fail=1\nrm -f conf$$subs.awk\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n_ACAWK\ncat >>\"\\$ac_tmp/subs1.awk\" <<_ACAWK &&\n  for (key in S) S_is_set[key] = 1\n  FS = \"\u0007\"\n\n}\n{\n  line = $ 0\n  nfields = split(line, field, \"@\")\n  substed = 0\n  len = length(field[1])\n  for (i = 2; i < nfields; i++) {\n    key = field[i]\n    keylen = length(key)\n    if (S_is_set[key]) {\n      value = S[key]\n      line = substr(line, 1, len) \"\" value \"\" substr(line, len + keylen + 3)\n      len += length(value) + length(field[++i])\n      substed = 1\n    } else\n      len += 1 + keylen\n  }\n\n  print line\n}\n\n_ACAWK\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nif sed \"s/$ac_cr//\" < /dev/null > /dev/null 2>&1; then\n  sed \"s/$ac_cr\\$//; s/$ac_cr/$ac_cs_awk_cr/g\"\nelse\n  cat\nfi < \"$ac_tmp/subs1.awk\" > \"$ac_tmp/subs.awk\" \\\n  || as_fn_error $? \"could not setup config files machinery\" \"$LINENO\" 5\n_ACEOF\n\n# VPATH may cause trouble with some makes, so we remove sole $(srcdir),\n# ${srcdir} and @srcdir@ entries from VPATH if srcdir is \".\", strip leading and\n# trailing colons and then remove the whole line if VPATH becomes empty\n# (actually we leave an empty line to preserve line numbers).\nif test \"x$srcdir\" = x.; then\n  ac_vpsub='/^[\t ]*VPATH[\t ]*=[\t ]*/{\nh\ns///\ns/^/:/\ns/[\t ]*$/:/\ns/:\\$(srcdir):/:/g\ns/:\\${srcdir}:/:/g\ns/:@srcdir@:/:/g\ns/^:*//\ns/:*$//\nx\ns/\\(=[\t ]*\\).*/\\1/\nG\ns/\\n//\ns/^[^=]*=[\t ]*$//\n}'\nfi\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\nfi # test -n \"$CONFIG_FILES\"\n\n# Set up the scripts for CONFIG_HEADERS section.\n# No need to generate them if there are no CONFIG_HEADERS.\n# This happens for instance with './config.status Makefile'.\nif test -n \"$CONFIG_HEADERS\"; then\ncat >\"$ac_tmp/defines.awk\" <<\\_ACAWK ||\nBEGIN {\n_ACEOF\n\n# Transform confdefs.h into an awk script 'defines.awk', embedded as\n# here-document in config.status, that substitutes the proper values into\n# config.h.in to produce config.h.\n\n# Create a delimiter string that does not exist in confdefs.h, to ease\n# handling of long lines.\nac_delim='%!_!# '\nfor ac_last_try in false false :; do\n  ac_tt=`sed -n \"/$ac_delim/p\" confdefs.h`\n  if test -z \"$ac_tt\"; then\n    break\n  elif $ac_last_try; then\n    as_fn_error $? \"could not make $CONFIG_HEADERS\" \"$LINENO\" 5\n  else\n    ac_delim=\"$ac_delim!$ac_delim _$ac_delim!! \"\n  fi\ndone\n\n# For the awk script, D is an array of macro values keyed by name,\n# likewise P contains macro parameters if any.  Preserve backslash\n# newline sequences.\n\nac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*\nsed -n '\ns/.\\{148\\}/&'\"$ac_delim\"'/g\nt rset\n:rset\ns/^[\t ]*#[\t ]*define[\t ][\t ]*/ /\nt def\nd\n:def\ns/\\\\$//\nt bsnl\ns/[\"\\\\]/\\\\&/g\ns/^ \\('\"$ac_word_re\"'\\)\\(([^()]*)\\)[\t ]*\\(.*\\)/P[\"\\1\"]=\"\\2\"\\\nD[\"\\1\"]=\" \\3\"/p\ns/^ \\('\"$ac_word_re\"'\\)[\t ]*\\(.*\\)/D[\"\\1\"]=\" \\2\"/p\nd\n:bsnl\ns/[\"\\\\]/\\\\&/g\ns/^ \\('\"$ac_word_re\"'\\)\\(([^()]*)\\)[\t ]*\\(.*\\)/P[\"\\1\"]=\"\\2\"\\\nD[\"\\1\"]=\" \\3\\\\\\\\\\\\n\"\\\\/p\nt cont\ns/^ \\('\"$ac_word_re\"'\\)[\t ]*\\(.*\\)/D[\"\\1\"]=\" \\2\\\\\\\\\\\\n\"\\\\/p\nt cont\nd\n:cont\nn\ns/.\\{148\\}/&'\"$ac_delim\"'/g\nt clear\n:clear\ns/\\\\$//\nt bsnlc\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\"/p\nd\n:bsnlc\ns/[\"\\\\]/\\\\&/g; s/^/\"/; s/$/\\\\\\\\\\\\n\"\\\\/p\nb cont\n' <confdefs.h | sed '\ns/'\"$ac_delim\"'/\"\\\\\\\n\"/g' >>$CONFIG_STATUS || ac_write_fail=1\n\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n  for (key in D) D_is_set[key] = 1\n  FS = \"\u0007\"\n}\n/^[\\t ]*#[\\t ]*(define|undef)[\\t ]+$ac_word_re([\\t (]|\\$)/ {\n  line = \\$ 0\n  split(line, arg, \" \")\n  if (arg[1] == \"#\") {\n    defundef = arg[2]\n    mac1 = arg[3]\n  } else {\n    defundef = substr(arg[1], 2)\n    mac1 = arg[2]\n  }\n  split(mac1, mac2, \"(\") #)\n  macro = mac2[1]\n  prefix = substr(line, 1, index(line, defundef) - 1)\n  if (D_is_set[macro]) {\n    # Preserve the white space surrounding the \"#\".\n    print prefix \"define\", macro P[macro] D[macro]\n    next\n  } else {\n    # Replace #undef with comments.  This is necessary, for example,\n    # in the case of _POSIX_SOURCE, which is predefined and required\n    # on some systems where configure will not decide to define it.\n    if (defundef == \"undef\") {\n      print \"/*\", prefix defundef, macro, \"*/\"\n      next\n    }\n  }\n}\n{ print }\n_ACAWK\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n  as_fn_error $? \"could not setup config headers machinery\" \"$LINENO\" 5\nfi # test -n \"$CONFIG_HEADERS\"\n\n\neval set X \"  :F $CONFIG_FILES  :H $CONFIG_HEADERS    \"\nshift\nfor ac_tag\ndo\n  case $ac_tag in\n  :[FHLC]) ac_mode=$ac_tag; continue;;\n  esac\n  case $ac_mode$ac_tag in\n  :[FHL]*:*);;\n  :L* | :C*:*) as_fn_error $? \"invalid tag '$ac_tag'\" \"$LINENO\" 5;;\n  :[FH]-) ac_tag=-:-;;\n  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;\n  esac\n  ac_save_IFS=$IFS\n  IFS=:\n  set x $ac_tag\n  IFS=$ac_save_IFS\n  shift\n  ac_file=$1\n  shift\n\n  case $ac_mode in\n  :L) ac_source=$1;;\n  :[FH])\n    ac_file_inputs=\n    for ac_f\n    do\n      case $ac_f in\n      -) ac_f=\"$ac_tmp/stdin\";;\n      *) # Look for the file first in the build tree, then in the source tree\n\t # (if the path is not absolute).  The absolute path cannot be DOS-style,\n\t # because $ac_f cannot contain ':'.\n\t test -f \"$ac_f\" ||\n\t   case $ac_f in\n\t   [\\\\/$]*) false;;\n\t   *) test -f \"$srcdir/$ac_f\" && ac_f=\"$srcdir/$ac_f\";;\n\t   esac ||\n\t   as_fn_error 1 \"cannot find input file: '$ac_f'\" \"$LINENO\" 5;;\n      esac\n      case $ac_f in *\\'*) ac_f=`printf \"%s\\n\" \"$ac_f\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;; esac\n      as_fn_append ac_file_inputs \" '$ac_f'\"\n    done\n\n    # Let's still pretend it is 'configure' which instantiates (i.e., don't\n    # use $as_me), people would be surprised to read:\n    #    /* config.h.  Generated by config.status.  */\n    configure_input='Generated from '`\n\t  printf \"%s\\n\" \"$*\" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'\n\t`' by configure.'\n    if test x\"$ac_file\" != x-; then\n      configure_input=\"$ac_file.  $configure_input\"\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: creating $ac_file\" >&5\nprintf \"%s\\n\" \"$as_me: creating $ac_file\" >&6;}\n    fi\n    # Neutralize special characters interpreted by sed in replacement strings.\n    case $configure_input in #(\n    *\\&* | *\\|* | *\\\\* )\n       ac_sed_conf_input=`printf \"%s\\n\" \"$configure_input\" |\n       sed 's/[\\\\\\\\&|]/\\\\\\\\&/g'`;; #(\n    *) ac_sed_conf_input=$configure_input;;\n    esac\n\n    case $ac_tag in\n    *:-:* | *:-) cat >\"$ac_tmp/stdin\" \\\n      || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5 ;;\n    esac\n    ;;\n  esac\n\n  ac_dir=`$as_dirname -- \"$ac_file\" ||\n$as_expr X\"$ac_file\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)[^/]' \\| \\\n\t X\"$ac_file\" : 'X\\(//\\)$' \\| \\\n\t X\"$ac_file\" : 'X\\(/\\)' \\| . 2>/dev/null ||\nprintf \"%s\\n\" X\"$ac_file\" |\n    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)[^/].*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\/\\)$/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  /^X\\(\\/\\).*/{\n\t    s//\\1/\n\t    q\n\t  }\n\t  s/.*/./; q'`\n  as_dir=\"$ac_dir\"; as_fn_mkdir_p\n  ac_builddir=.\n\ncase \"$ac_dir\" in\n.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;\n*)\n  ac_dir_suffix=/`printf \"%s\\n\" \"$ac_dir\" | sed 's|^\\.[\\\\/]||'`\n  # A \"..\" for each directory in $ac_dir_suffix.\n  ac_top_builddir_sub=`printf \"%s\\n\" \"$ac_dir_suffix\" | sed 's|/[^\\\\/]*|/..|g;s|/||'`\n  case $ac_top_builddir_sub in\n  \"\") ac_top_builddir_sub=. ac_top_build_prefix= ;;\n  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;\n  esac ;;\nesac\nac_abs_top_builddir=$ac_pwd\nac_abs_builddir=$ac_pwd$ac_dir_suffix\n# for backward compatibility:\nac_top_builddir=$ac_top_build_prefix\n\ncase $srcdir in\n  .)  # We are building in place.\n    ac_srcdir=.\n    ac_top_srcdir=$ac_top_builddir_sub\n    ac_abs_top_srcdir=$ac_pwd ;;\n  [\\\\/]* | ?:[\\\\/]* )  # Absolute name.\n    ac_srcdir=$srcdir$ac_dir_suffix;\n    ac_top_srcdir=$srcdir\n    ac_abs_top_srcdir=$srcdir ;;\n  *) # Relative name.\n    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix\n    ac_top_srcdir=$ac_top_build_prefix$srcdir\n    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;\nesac\nac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix\n\n\n  case $ac_mode in\n  :F)\n  #\n  # CONFIG_FILE\n  #\n\n  case $INSTALL in\n  [\\\\/$]* | ?:[\\\\/]* ) ac_INSTALL=$INSTALL ;;\n  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;\n  esac\n_ACEOF\n\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n# If the template does not know about datarootdir, expand it.\n# FIXME: This hack should be removed a few years after 2.60.\nac_datarootdir_hack=; ac_datarootdir_seen=\nac_sed_dataroot='\n/datarootdir/ {\n  p\n  q\n}\n/@datadir@/p\n/@docdir@/p\n/@infodir@/p\n/@localedir@/p\n/@mandir@/p'\ncase `eval \"sed -n \\\"\\$ac_sed_dataroot\\\" $ac_file_inputs\"` in\n*datarootdir*) ac_datarootdir_seen=yes;;\n*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting\" >&2;}\n_ACEOF\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\n  ac_datarootdir_hack='\n  s&@datadir@&$datadir&g\n  s&@docdir@&$docdir&g\n  s&@infodir@&$infodir&g\n  s&@localedir@&$localedir&g\n  s&@mandir@&$mandir&g\n  s&\\\\\\${datarootdir}&$datarootdir&g' ;;\nesac\n_ACEOF\n\n# Neutralize VPATH when '$srcdir' = '.'.\n# Shell code in configure.ac might set extrasub.\n# FIXME: do we really want to maintain this feature?\ncat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1\nac_sed_extra=\"$ac_vpsub\n$extrasub\n_ACEOF\ncat >>$CONFIG_STATUS <<\\_ACEOF || ac_write_fail=1\n:t\n/@[a-zA-Z_][a-zA-Z_0-9]*@/!b\ns|@configure_input@|$ac_sed_conf_input|;t t\ns&@top_builddir@&$ac_top_builddir_sub&;t t\ns&@top_build_prefix@&$ac_top_build_prefix&;t t\ns&@srcdir@&$ac_srcdir&;t t\ns&@abs_srcdir@&$ac_abs_srcdir&;t t\ns&@top_srcdir@&$ac_top_srcdir&;t t\ns&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t\ns&@builddir@&$ac_builddir&;t t\ns&@abs_builddir@&$ac_abs_builddir&;t t\ns&@abs_top_builddir@&$ac_abs_top_builddir&;t t\ns&@INSTALL@&$ac_INSTALL&;t t\n$ac_datarootdir_hack\n\"\neval sed \\\"\\$ac_sed_extra\\\" \"$ac_file_inputs\" | $AWK -f \"$ac_tmp/subs.awk\" \\\n  >$ac_tmp/out || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n\ntest -z \"$ac_datarootdir_hack$ac_datarootdir_seen\" &&\n  { ac_out=`sed -n '/\\${datarootdir}/p' \"$ac_tmp/out\"`; test -n \"$ac_out\"; } &&\n  { ac_out=`sed -n '/^[\t ]*datarootdir[\t ]*:*=/p' \\\n      \"$ac_tmp/out\"`; test -z \"$ac_out\"; } &&\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir'\nwhich seems to be undefined.  Please make sure it is defined\" >&2;}\n\n  rm -f \"$ac_tmp/stdin\"\n  case $ac_file in\n  -) cat \"$ac_tmp/out\" && rm -f \"$ac_tmp/out\";;\n  *) rm -f \"$ac_file\" && mv \"$ac_tmp/out\" \"$ac_file\";;\n  esac \\\n  || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n ;;\n  :H)\n  #\n  # CONFIG_HEADER\n  #\n  if test x\"$ac_file\" != x-; then\n    {\n      printf \"%s\\n\" \"/* $configure_input  */\" >&1 \\\n      && eval '$AWK -f \"$ac_tmp/defines.awk\"' \"$ac_file_inputs\"\n    } >\"$ac_tmp/config.h\" \\\n      || as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n    if diff \"$ac_file\" \"$ac_tmp/config.h\" >/dev/null 2>&1; then\n      { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: $ac_file is unchanged\" >&5\nprintf \"%s\\n\" \"$as_me: $ac_file is unchanged\" >&6;}\n    else\n      rm -f \"$ac_file\"\n      mv \"$ac_tmp/config.h\" \"$ac_file\" \\\n\t|| as_fn_error $? \"could not create $ac_file\" \"$LINENO\" 5\n    fi\n  else\n    printf \"%s\\n\" \"/* $configure_input  */\" >&1 \\\n      && eval '$AWK -f \"$ac_tmp/defines.awk\"' \"$ac_file_inputs\" \\\n      || as_fn_error $? \"could not create -\" \"$LINENO\" 5\n  fi\n ;;\n\n\n  esac\n\ndone # for ac_tag\n\n\nas_fn_exit 0\n_ACEOF\nac_clean_files=$ac_clean_files_save\n\ntest $ac_write_fail = 0 ||\n  as_fn_error $? \"write failure creating $CONFIG_STATUS\" \"$LINENO\" 5\n\n\n# configure is writing to config.log, and then calls config.status.\n# config.status does its own redirection, appending to config.log.\n# Unfortunately, on DOS this fails, as config.log is still kept open\n# by configure, so config.status won't be able to write to it; its\n# output is simply discarded.  So we exec the FD to /dev/null,\n# effectively closing config.log, so it can be properly (re)opened and\n# appended to by config.status.  When coming back to configure, we\n# need to make the FD available again.\nif test \"$no_create\" != yes; then\n  ac_cs_success=:\n  ac_config_status_args=\n  test \"$silent\" = yes &&\n    ac_config_status_args=\"$ac_config_status_args --quiet\"\n  exec 5>/dev/null\n  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false\n  exec 5>>config.log\n  # Use ||, not &&, to avoid exiting from the if with $? = 1, which\n  # would make configure fail if this is the last instruction.\n  $ac_cs_success || as_fn_exit 1\nfi\nif test -n \"$ac_unrecognized_opts\" && test \"$enable_option_checking\" != no; then\n  { printf \"%s\\n\" \"$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts\" >&5\nprintf \"%s\\n\" \"$as_me: WARNING: unrecognized options: $ac_unrecognized_opts\" >&2;}\nfi\n\nchmod u+x test/runtest.sh\n\n"
  },
  {
    "path": "configure.in",
    "content": "#                                               -*- Autoconf -*-\n# Process this file with autoconf to produce a configure script.\n\nAC_PREREQ([2.62])\nAC_INIT([pgreplay], [1.5.0], [https://github.com/laurenz/pgreplay/issues], [pgreplay], [http://laurenz.github.io/pgreplay/])\nAC_CONFIG_SRCDIR([parse.c])\nAC_CONFIG_HEADERS([config.h])\nAC_CANONICAL_BUILD\n\n# Checks for programs.\nAC_PROG_INSTALL\nAC_PROG_CC([gcc cc])\n# add -Wall to CFLAGS for gcc\nif test \"$GCC\" = yes; then CFLAGS=\"-Wall $CFLAGS\"; fi\n\n# check if ld supports -rpath\nAC_MSG_CHECKING([whether the linker supports -rpath])\nsave_LDFLAGS=\"$LDFLAGS\"\nLDFLAGS=\"$LDFLAGS -Wl,-rpath,/usr/lib\"\nAC_LINK_IFELSE([AC_LANG_SOURCE([[main() {}]])], [rpath=yes], [rpath=no])\nLDFLAGS=\"$save_LDFLAGS\"\nAC_MSG_RESULT([$rpath])\n\nAC_ARG_WITH([postgres],\n\t[AS_HELP_STRING([--with-postgres=DIR],\n\t\t[specify location of pg_config for your PostgreSQL installation])],\n\t[if ! test -x \"$with_postgres\"/pg_config; then\n\t\techo \"*** pg_config not found in '$with_postgres'\" 1>&2\n\t\texit 1\n\tfi\n\tpgbindir=`\"$with_postgres\"/pg_config --bindir`\n\tAC_SUBST([pgbindir])\n\tif test $build_os = mingw32; then pglibdir=\"$pgbindir\"; else pglibdir=`\"$with_postgres\"/pg_config --libdir`; fi\n\tpgincludedir=`\"$with_postgres\"/pg_config --includedir`\n\tLDFLAGS=\"$LDFLAGS -L$pglibdir\"\n\tif test $rpath = yes; then LDFLAGS=\"$LDFLAGS -Wl,-rpath,$pglibdir\"; fi\n\tCFLAGS=\"$CFLAGS -I$pgincludedir\"\n\tPATH=`\"$with_postgres\"/pg_config --bindir`:$PATH])\n\n# Install with PostgreSQL by default\nAC_PREFIX_PROGRAM(pg_config)\n\n# Checks for libraries.\nAC_CHECK_LIB([pq], [PQsendPrepare], [], [AC_MSG_ERROR([\n*** cannot locate PostgreSQL client library\n*** required is version 8.0 or better\n])])\n\n# special Windows settings\nif test $build_os = mingw32; then\n\tAC_SUBST([EXTRA_OBJS], [windows.o])\n\t# assume socks library is present\n\t# we have a problem using AC_CHECK_LIB because the function is __stdcall\n\tLIBS=\"$LIBS -lwsock32\"\nfi\n\n# Checks for header files.\nAC_HEADER_TIME\nAC_CHECK_HEADERS([fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/time.h unistd.h inttypes.h])\nAC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([PostgreSQL header files not found])], [/* dummy */])\n\n# Checks for typedefs, structures, and compiler characteristics.\nAC_SYS_LARGEFILE\nAC_TYPE_SIZE_T\nAC_TYPE_SSIZE_T\nAC_TYPE_UINT64_T\nAC_TYPE_UINT32_T\nAC_CHECK_SIZEOF(unsigned int)\nAC_CHECK_SIZEOF(unsigned long)\nAC_CHECK_SIZEOF(unsigned short)\nAC_C_BIGENDIAN\n\n# Checks for library functions.\nAC_FUNC_STRTOD\nAC_CHECK_FUNCS([gettimeofday select setenv strchr strtoul])\n\nAC_CONFIG_FILES([Makefile test/runtest.sh])\nAC_OUTPUT\nchmod u+x test/runtest.sh\n"
  },
  {
    "path": "database.c",
    "content": "#include \"pgreplay.h\"\n\n#include <errno.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <libpq-fe.h>\n#ifdef HAVE_SYS_SELECT_H\n#\tinclude <sys/select.h>\n#else\n#\tinclude <sys/types.h>\n#\tinclude <unistd.h>\n#endif\n#ifdef TIME_WITH_SYS_TIME\n#\tinclude <sys/time.h>\n#\tinclude <time.h>\n#else\n#\tifdef HAVE_SYS_TIME_H\n#\t\tinclude <sys/time.h>\n#\telse\n#\t\tinclude <time.h>\n#\tendif\n#endif\n#ifdef WINDOWS\n#\tinclude <windows.h>\n#endif\n\n/*\n * Utility macros to calculate with struct timeval.\n * These are already defined on BSD type systems.\n */\n\n#ifndef timeradd\n#\tdefine timeradd(a, b, result)  \\\n\tdo {  \\\n\t\t(result)->tv_sec = (a)->tv_sec + (b)->tv_sec;  \\\n\t\t(result)->tv_usec = (a)->tv_usec + (b)->tv_usec;  \\\n\t\tif ((result)->tv_usec >= 1000000) {  \\\n\t\t\t++(result)->tv_sec;  \\\n\t\t\t(result)->tv_usec -= 1000000;  \\\n\t\t}  \\\n\t} while (0)\n#endif\n\n#ifndef timersub\n#\tdefine timersub(a, b, result)  \\\n\tdo {  \\\n\t\t(result)->tv_sec = (a)->tv_sec - (b)->tv_sec;  \\\n\t\t(result)->tv_usec = (a)->tv_usec - (b)->tv_usec;  \\\n\t\tif ((result)->tv_usec < 0) {  \\\n\t\t\t--(result)->tv_sec;  \\\n\t\t\t(result)->tv_usec += 1000000;  \\\n\t\t}  \\\n\t} while (0)\n#endif\n\n/* connect string */\nstatic char *conn_string;\n\n/* speed factor for replay */\nstatic double replay_factor;\n\n/* possible stati a connection can have */\ntypedef enum {\n\tidle = 0,\n\tconn_wait_write,\n\tconn_wait_read,\n\twait_write,\n\twait_read,\n\tclosed\n} connstatus;\n\n/* linked list element for list of open connections */\nstruct dbconn {\n\tuint64_t       session_id;\n\tPGconn         *db_conn;\n\tint            socket;\n\tconnstatus     status;\n\tstruct timeval session_start;\n\tstruct timeval stmt_start;\n\tchar           *errmsg;\n\tstruct dbconn  *next;\n};\n\n/* linked list of open connections */\nstatic struct dbconn *connections = NULL;\n\n/* remember timestamp of program start and stop */\nstatic struct timeval start_time;\nstatic struct timeval stop_time;\n\n/* remember timestamp of first statement */\nstatic struct timeval first_stmt_time;\nstatic struct timeval last_stmt_time;\n\n/* maximum seconds behind schedule */\nstatic time_t secs_behind = 0;\n\n/* time skipped instead of sleeping through it */\nstatic struct timeval jump_total = {0, 0};\n\n/* statistics */\nstatic struct timeval stat_exec = {0, 0};     /* SQL statement execution time */\nstatic struct timeval stat_session = {0, 0};  /* session duration total */\nstatic struct timeval stat_longstmt = {0, 0}; /* session duration total */\nstatic unsigned long stat_stmt = 0;           /* number of SQL statements */\nstatic unsigned long stat_prep = 0;           /* number of preparations */\nstatic unsigned long stat_errors = 0;         /* unsuccessful SQL statements and preparations */\nstatic unsigned long stat_actions = 0;        /* client-server interactions */\nstatic unsigned long stat_statements = 0;     /* number of concurrent statements */\nstatic unsigned long stat_stmtmax = 0;        /* maximum concurrent statements */\nstatic unsigned long stat_sesscnt = 0;        /* total number of sessions */\nstatic unsigned long stat_sessions = 0;       /* number of concurrent sessions */\nstatic unsigned long stat_sessmax = 0;        /* maximum concurrent sessions */\nstatic unsigned long stat_hist[5] = {0, 0, 0, 0, 0};  /* duration histogram */\n\n#define NUM_DELAY_STEPS 11\n\n/* steps for execution delay reports */\nstatic struct {\n\tint seconds;\n\tchar *display;\n\tshort int shown;\n} delay_steps[NUM_DELAY_STEPS] = {\n\t{10, \"10 seconds\", 0},\n\t{30, \"30 seconds\", 0},\n\t{60, \"1 minute\", 0},\n\t{180, \"3 minutes\", 0},\n\t{600, \"10 minutes\", 0},\n\t{1800, \"30 minutes\", 0},\n\t{3600, \"1 hour\", 0},\n\t{7200, \"2 hours\", 0},\n\t{21600, \"6 hours\", 0},\n\t{43200, \"12 hours\", 0},\n\t{86400, \"1 day\", 0}\n};\n\n/* processes (ignores) notices from the server */\nstatic void ignore_notices(void *arg, const PGresult *res) {\n}\n\n/* encapsulates \"select\" call and error handling */\n\nstatic int do_select(int n, fd_set *rfds, fd_set *wfds, fd_set *xfds, struct timeval *timeout) {\n\tint rc;\n\n\trc = select(n, rfds, wfds, xfds, timeout);\n#ifdef WINDOWS\n\tif (SOCKET_ERROR == rc) {\n\t\twin_perror(\"Error in select()\", 1);\n\t\trc = -1;\n\t}\n#else\n\tif (-1 == rc) {\n\t\tperror(\"Error in select()\");\n\t}\n#endif\n\n\treturn rc;\n}\n\n/* checks if a certain socket can be read or written without blocking */\n\nstatic int poll_socket(int socket, int for_read, char * const errmsg_prefix) {\n\tfd_set fds;\n\tstruct timeval zero = { 0, 0 };\n\n\tFD_ZERO(&fds);\n\tFD_SET(socket, &fds);\n\treturn do_select(socket + 1, for_read ? &fds : NULL, for_read ? NULL : &fds, NULL, &zero);\n}\n\n/* sleep routine that should work on all platforms */\n\nstatic int do_sleep(struct timeval *delta) {\n\tdebug(2, \"Napping for %lu.%06lu seconds\\n\", (unsigned long)delta->tv_sec, (unsigned long)delta->tv_usec);\n#ifdef WINDOWS\n\tSleep((DWORD)delta->tv_sec * 1000 + (DWORD)(delta->tv_usec / 1000));\n\treturn 0;\n#else\n\treturn do_select(0, NULL, NULL, NULL, delta);\n#endif\n}\n\nstatic void print_replay_statistics(int dry_run) {\n\tint hours, minutes;\n\tdouble seconds, runtime, session_time, busy_time;\n\tstruct timeval delta;\n\tunsigned long histtotal =\n\t\tstat_hist[0] + stat_hist[1] + stat_hist[2] + stat_hist[3] + stat_hist[4];\n\n\tif (dry_run) {\n\t\tfprintf(sf, \"\\nReplay statistics (dry run)\\n\");\n\t\tfprintf(sf, \"===========================\\n\\n\");\n\n\t\t/* calculate lengh of the recorded workload */\n\t\ttimersub(&last_stmt_time, &first_stmt_time, &delta);\n\t\thours = delta.tv_sec / 3600;\n\t\tdelta.tv_sec -= hours * 3600;\n\t\tminutes = delta.tv_sec / 60;\n\t\tdelta.tv_sec -= minutes * 60;\n\t\tseconds = delta.tv_usec / 1000000.0 + delta.tv_sec;\n\n\t\tfprintf(sf, \"Duration of recorded workload:\");\n\t\tif (hours > 0) {\n\t\t\tfprintf(sf, \" %d hours\", hours);\n\t\t}\n\t\tif (minutes > 0) {\n\t\t\tfprintf(sf, \" %d minutes\", minutes);\n\t\t}\n\t\tfprintf(sf, \" %.3f seconds\\n\", seconds);\n\t\tfprintf(sf, \"Calls to the server: %lu\\n\", stat_actions);\n\t} else {\n\t\tfprintf(sf, \"\\nReplay statistics\\n\");\n\t\tfprintf(sf, \"=================\\n\\n\");\n\n\t\t/* calculate total run time */\n\t\ttimersub(&stop_time, &start_time, &delta);\n\t\truntime = delta.tv_usec / 1000000.0 + delta.tv_sec;\n\t\t/* calculate hours and minutes, subtract from delta */\n\t\thours = delta.tv_sec / 3600;\n\t\tdelta.tv_sec -= hours * 3600;\n\t\tminutes = delta.tv_sec / 60;\n\t\tdelta.tv_sec -= minutes * 60;\n\t\tseconds = delta.tv_usec / 1000000.0 + delta.tv_sec;\n\t\t/* calculate total busy time */\n\t\tbusy_time = stat_exec.tv_usec / 1000000.0 + stat_exec.tv_sec;\n\t\t/* calculate total session time */\n\t\tsession_time = stat_session.tv_usec / 1000000.0 + stat_session.tv_sec;\n\n\t\tfprintf(sf, \"Speed factor for replay: %.3f\\n\", replay_factor);\n\t\tfprintf(sf, \"Total run time:\");\n\t\tif (hours > 0) {\n\t\t\tfprintf(sf, \" %d hours\", hours);\n\t\t}\n\t\tif (minutes > 0) {\n\t\t\tfprintf(sf, \" %d minutes\", minutes);\n\t\t}\n\t\tfprintf(sf, \" %.3f seconds\\n\", seconds);\n\t\tfprintf(sf, \"Maximum lag behind schedule: %lu seconds\\n\", (unsigned long) secs_behind);\n\t\tfprintf(sf, \"Calls to the server: %lu\\n\", stat_actions);\n\t\tif (runtime > 0.0) {\n\t\t\tfprintf(sf, \"(%.3f calls per second)\\n\", stat_actions / runtime);\n\t\t}\n\t}\n\n\tfprintf(sf, \"Total number of connections: %lu\\n\", stat_sesscnt);\n\tfprintf(sf, \"Maximum number of concurrent connections: %lu\\n\", stat_sessmax);\n\tif (!dry_run && runtime > 0.0) {\n\t\tfprintf(sf, \"Average number of concurrent connections: %.3f\\n\", session_time / runtime);\n\t}\n\tif (!dry_run && session_time > 0.0) {\n\t\tfprintf(sf, \"Average session idle percentage: %.3f%%\\n\", 100.0 * (session_time - busy_time) / session_time);\n\t}\n\n\tfprintf(sf, \"SQL statements executed: %lu\\n\", stat_stmt - stat_prep);\n\tif (!dry_run && stat_stmt > stat_prep) {\n\t\tfprintf(sf, \"(%lu or %.3f%% of these completed with error)\\n\",\n\t\t\tstat_errors, (100.0 * stat_errors) / (stat_stmt - stat_prep));\n\t\tfprintf(sf, \"Maximum number of concurrent SQL statements: %lu\\n\", stat_stmtmax);\n\t\tif (runtime > 0.0) {\n\t\t\tfprintf(sf, \"Average number of concurrent SQL statements: %.3f\\n\", busy_time / runtime);\n\t\t}\n\t\tfprintf(sf, \"Average SQL statement duration: %.3f seconds\\n\", busy_time / stat_stmt);\n\t\tfprintf(sf, \"Maximum SQL statement duration: %.3f seconds\\n\",\n\t\t\tstat_longstmt.tv_sec + stat_longstmt.tv_usec / 1000000.0);\n\t\tfprintf(sf, \"Statement duration histogram:\\n\");\n\t\tfprintf(sf, \"  0    to 0.02 seconds: %.3f%%\\n\", 100.0 * stat_hist[0] / histtotal);\n\t\tfprintf(sf, \"  0.02 to 0.1  seconds: %.3f%%\\n\", 100.0 * stat_hist[1] / histtotal);\n\t\tfprintf(sf, \"  0.1  to 0.5  seconds: %.3f%%\\n\", 100.0 * stat_hist[2] / histtotal);\n\t\tfprintf(sf, \"  0.5  to 2    seconds: %.3f%%\\n\", 100.0 * stat_hist[3] / histtotal);\n\t\tfprintf(sf, \"     over 2    seconds: %.3f%%\\n\", 100.0 * stat_hist[4] / histtotal);\n\t}\n}\n\nint database_consumer_init(const char *ignore, const char *host, int port, const char *passwd, double factor) {\n\tint conn_string_len = 12;  /* port and '\\0' */\n\tconst char *p;\n\tchar *p1;\n\n\tdebug(3, \"Entering database_consumer_init%s\\n\", \"\");\n\n\t/* get time of program start */\n\tif (-1 == gettimeofday(&start_time, NULL)) {\n\t\tperror(\"Error calling gettimeofday\");\n\t\treturn 0;\n\t}\n\n\treplay_factor = factor;\n\n\t/* calculate length of connect string */\n\tif (host) {\n\t\tconn_string_len += 8;\n\t\tfor (p=host; '\\0'!=*p; ++p) {\n\t\t\tif (('\\'' == *p) || ('\\\\' == *p)) {\n\t\t\t\tconn_string_len += 2;\n\t\t\t} else {\n\t\t\t\t++conn_string_len;\n\t\t\t}\n\t\t}\n\t}\n\tif (passwd) {\n\t\tconn_string_len += 12;\n\t\tfor (p=passwd; '\\0'!=*p; ++p) {\n\t\t\tif (('\\'' == *p) || ('\\\\' == *p)) {\n\t\t\t\tconn_string_len += 2;\n\t\t\t} else {\n\t\t\t\t++conn_string_len;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (extra_connstr)\n\t\tconn_string_len += strlen(extra_connstr);\n\n\tif (NULL == (conn_string = malloc(conn_string_len))) {\n\t\tfprintf(stderr, \"Cannot allocate %d bytes of memory\\n\", conn_string_len);\n\t\treturn 0;\n\t}\n\t/* write the port to the connection string if it is set */\n\tif (-1 == port) {\n\t\tconn_string[0] = '\\0';\n\t} else {\n\t\tif (sprintf(conn_string, \"port=%d\", port) < 0) {\n\t\t\tperror(\"Error writing connect string:\");\n\t\t\tfree(conn_string);\n\t\t\treturn 0;\n\t\t}\n\t}\n\tfor (p1=conn_string; '\\0'!=*p1; ++p1) {\n\t\t/* places p1 at the end of the string */\n\t}\n\n\t/* append host if necessary */\n\tif (host) {\n\t\t*(p1++) = ' ';\n\t\t*(p1++) = 'h';\n\t\t*(p1++) = 'o';\n\t\t*(p1++) = 's';\n\t\t*(p1++) = 't';\n\t\t*(p1++) = '=';\n\t\t*(p1++) = '\\'';\n\t\tfor (p=host; '\\0'!=*p; ++p) {\n\t\t\tif (('\\'' == *p) || ('\\\\' == *p)) {\n\t\t\t\t*(p1++) = '\\\\';\n\t\t\t}\n\t\t\t*(p1++) = *p;\n\t\t}\n\t\t*(p1++) = '\\'';\n\t\t*p1 = '\\0';\n\t}\n\n\t/* append password if necessary */\n\tif (passwd) {\n\t\t*(p1++) = ' ';\n\t\t*(p1++) = 'p';\n\t\t*(p1++) = 'a';\n\t\t*(p1++) = 's';\n\t\t*(p1++) = 's';\n\t\t*(p1++) = 'w';\n\t\t*(p1++) = 'o';\n\t\t*(p1++) = 'r';\n\t\t*(p1++) = 'd';\n\t\t*(p1++) = '=';\n\t\t*(p1++) = '\\'';\n\t\tfor (p=passwd; '\\0'!=*p; ++p) {\n\t\t\tif (('\\'' == *p) || ('\\\\' == *p)) {\n\t\t\t\t*(p1++) = '\\\\';\n\t\t\t}\n\t\t\t*(p1++) = *p;\n\t\t}\n\t\t*(p1++) = '\\'';\n\t\t*p1 = '\\0';\n\t}\n\n\tif (extra_connstr) {\n\t\t*(p1++) = ' ';\n\t\tstrcpy(p1, extra_connstr);\n\t}\n\n\tdebug(2, \"Database connect string: \\\"%s\\\"\\n\", conn_string);\n\n\tdebug(3, \"Leaving database_consumer_init%s\\n\", \"\");\n\treturn 1;\n}\n\nvoid database_consumer_finish(int dry_run) {\n\tdebug(3, \"Entering database_consumer_finish%s\\n\", \"\");\n\n\tfree(conn_string);\n\n\tif (NULL != connections) {\n\t\tfprintf(stderr, \"Error: not all database connections closed\\n\");\n\t}\n\n\tif (-1 == gettimeofday(&stop_time, NULL)) {\n\t\tperror(\"Error calling gettimeofday\");\n\t} else if (sf) {\n\t\tprint_replay_statistics(dry_run);\n\t}\n\n\tdebug(3, \"Leaving database_consumer_finish%s\\n\", \"\");\n}\n\nint database_consumer(replay_item *item) {\n\tconst uint64_t session_id = replay_get_session_id(item);\n\tconst replay_type type = replay_get_type(item);\n\tint all_idle = 1, rc = 0, j;\n\tstruct dbconn *conn = connections, *found_conn = NULL, *prev_conn = NULL;\n\tstruct timeval target_time, now, delta;\n\tconst struct timeval *stmt_time;\n\tstatic int fstmtm_set = 0;  /* have we already collected first_statement_time */\n\tdouble d;\n\ttime_t i;\n\tchar *connstr, *p1, errbuf[256];\n\tconst char *user, *database, *p;\n\tPGcancel *cancel_request;\n\tPGresult *result;\n\tExecStatusType result_status;\n\n\tdebug(3, \"Entering database_consumer%s\\n\", \"\");\n\n\t/* loop through open connections and do what can be done */\n\twhile ((-1 != rc) && (NULL != conn)) {\n\t\t/* if we find the connection for the current statement, remember it */\n\t\tif (session_id == conn->session_id) {\n\t\t\tfound_conn = conn;\n\t\t}\n\n\t\t/* handle each connection according to status */\n\t\tswitch(conn->status) {\n\t\t\tcase idle:\n\t\t\tcase closed:\n\t\t\t\tbreak;  /* nothing to do */\n\n\t\t\tcase conn_wait_read:\n\t\t\tcase conn_wait_write:\n\t\t\t\t/* in connection process */\n\t\t\t\t/* check if socket is still busy */\n\t\t\t\tswitch (poll_socket(conn->socket, (conn_wait_read == conn->status), \"Error polling socket during connect\")) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t/* socket still busy */\n\t\t\t\t\t\tdebug(2, \"Socket for session 0x\" UINT64_FORMAT \" busy for %s during connect\\n\", conn->session_id, (conn_wait_write == conn->status) ? \"write\" : \"read\");\n\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase -1:\n\t\t\t\t\t\t/* error happened in select() */\n\t\t\t\t\t\trc = -1;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t/* socket not busy, continue connect process */\n\t\t\t\t\t\tswitch(PQconnectPoll(conn->db_conn)) {\n\t\t\t\t\t\t\tcase PGRES_POLLING_WRITING:\n\t\t\t\t\t\t\t\tconn->status = conn_wait_write;\n\t\t\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase PGRES_POLLING_READING:\n\t\t\t\t\t\t\t\tconn->status = conn_wait_read;\n\t\t\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase PGRES_POLLING_OK:\n\t\t\t\t\t\t\t\tdebug(2, \"Connection for session 0x\" UINT64_FORMAT \" established\\n\", conn->session_id);\n\t\t\t\t\t\t\t\tconn->status = idle;\n\n\t\t\t\t\t\t\t\t/* get session start time */\n\t\t\t\t\t\t\t\tif (-1 == gettimeofday(&(conn->session_start), NULL)) {\n\t\t\t\t\t\t\t\t\tperror(\"Error calling gettimeofday\");\n\t\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t/* count total and concurrent sessions */\n\t\t\t\t\t\t\t\t++stat_sesscnt;\n\t\t\t\t\t\t\t\tif (++stat_sessions > stat_sessmax) {\n\t\t\t\t\t\t\t\t\tstat_sessmax = stat_sessions;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase PGRES_POLLING_FAILED:\n\t\t\t\t\t\t\t\t/* If the connection fails because of a\n\t\t\t\t\t\t\t\t   FATAL error from the server, mark\n\t\t\t\t\t\t\t\t   connection \"closed\" and keep going.\n\t\t\t\t\t\t\t\t   The same thing probably happened in the\n\t\t\t\t\t\t\t\t   original run.\n\t\t\t\t\t\t\t\t   PostgreSQL logs no disconnection for this.\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\tp1 = PQerrorMessage(conn->db_conn);\n\t\t\t\t\t\t\t\tif (0 == strncmp(p1, \"FATAL:  \", 8)) {\n\t\t\t\t\t\t\t\t\tp1 += 8;\n\t\t\t\t\t\t\t\t\tif (NULL == (conn->errmsg = malloc(strlen(p1) + 1))) {\n\t\t\t\t\t\t\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)(strlen(p1) + 1));\n\t\t\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tdebug(2, \"Connection for session 0x\" UINT64_FORMAT \" failed with FATAL error: %s\\n\",\n\t\t\t\t\t\t\t\t\t\t\tconn->session_id, p1);\n\t\t\t\t\t\t\t\t\t\tstrcpy(conn->errmsg, p1);\n\t\t\t\t\t\t\t\t\t\tconn->status = closed;\n\t\t\t\t\t\t\t\t\t\tPQfinish(conn->db_conn);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/* else fall through */\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tfprintf(stderr, \"Connection for session 0x\" UINT64_FORMAT \" failed: %s\\n\", conn->session_id, PQerrorMessage(conn->db_conn));\n\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\t\tPQfinish(conn->db_conn);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase wait_write:\n\t\t\t\t/* check if the socket is writable */\n\t\t\t\tswitch (poll_socket(conn->socket, 0, \"Error polling socket for write\")) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t/* socket still busy */\n\t\t\t\t\t\tdebug(2, \"Session 0x\" UINT64_FORMAT \" busy writing data\\n\", conn->session_id);\n\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase -1:\n\t\t\t\t\t\t/* error in select() */\n\t\t\t\t\t\trc = -1;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t/* try PQflush again */\n\t\t\t\t\t\tdebug(2, \"Session 0x\" UINT64_FORMAT \" flushing data\\n\", conn->session_id);\n\t\t\t\t\t\tswitch (PQflush(conn->db_conn)) {\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t/* finished flushing all data */\n\t\t\t\t\t\t\t\tconn->status = wait_read;\n\t\t\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t/* more data to flush */\n\t\t\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tfprintf(stderr, \"Error flushing to database: %s\\n\", PQerrorMessage(conn->db_conn));\n\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase wait_read:\n\t\t\t\t/* check if the socket is readable */\n\t\t\t\tswitch (poll_socket(conn->socket, 1, \"Error polling socket for read\")) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t/* socket still busy */\n\t\t\t\t\t\tdebug(2, \"Session 0x\" UINT64_FORMAT \" waiting for data\\n\", conn->session_id);\n\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase -1:\n\t\t\t\t\t\t/* error during select() */\n\t\t\t\t\t\trc = -1;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t/* read input from connection */\n\t\t\t\t\t\tif (! PQconsumeInput(conn->db_conn)) {\n\t\t\t\t\t\t\tfprintf(stderr, \"Error reading from database: %s\\n\", PQerrorMessage(conn->db_conn));\n\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t/* check if we are done reading */\n\t\t\t\t\t\t\tif (PQisBusy(conn->db_conn)) {\n\t\t\t\t\t\t\t\t/* more to read */\n\t\t\t\t\t\t\t\tall_idle = 0;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t/* read and discard all results */\n\t\t\t\t\t\t\t\twhile (NULL != (result = PQgetResult(conn->db_conn))) {\n\t\t\t\t\t\t\t\t\t/* count statements and errors for statistics */\n\t\t\t\t\t\t\t\t\t++stat_stmt;\n\t\t\t\t\t\t\t\t\tresult_status = PQresultStatus(result);\n\t\t\t\t\t\t\t\t\tdebug(2, \"Session 0x\" UINT64_FORMAT \" got query response (%s)\\n\",\n\t\t\t\t\t\t\t\t\t\tconn->session_id,\n\t\t\t\t\t\t\t\t\t\t(PGRES_TUPLES_OK == result_status) ? \"PGRES_TUPLES_OK\" :\n\t\t\t\t\t\t\t\t\t\t((PGRES_COMMAND_OK == result_status) ? \"PGRES_COMMAND_OK\" :\n\t\t\t\t\t\t\t\t\t\t((PGRES_FATAL_ERROR == result_status) ? \"PGRES_FATAL_ERROR\" :\n\t\t\t\t\t\t\t\t\t\t((PGRES_NONFATAL_ERROR == result_status) ? \"PGRES_NONFATAL_ERROR\" :\n\t\t\t\t\t\t\t\t\t\t((PGRES_EMPTY_QUERY == result_status) ? \"PGRES_EMPTY_QUERY\" : \"unexpected status\")))));\n\n\t\t\t\t\t\t\t\t\tif (PGRES_FATAL_ERROR == result_status)\n\t\t\t\t\t\t\t\t\t\tdebug(1, \"Error message session 0x\" UINT64_FORMAT \": %s\\n\",\n\t\t\t\t\t\t\t\t\t\t\t  conn->session_id, PQresultErrorMessage(result));\n\n\t\t\t\t\t\t\t\t\tif ((PGRES_EMPTY_QUERY != result_status)\n\t\t\t\t\t\t\t\t\t\t&& (PGRES_COMMAND_OK != result_status)\n\t\t\t\t\t\t\t\t\t\t&& (PGRES_TUPLES_OK != result_status)\n\t\t\t\t\t\t\t\t\t\t&& (PGRES_NONFATAL_ERROR != result_status))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t++stat_errors;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tPQclear(result);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t/* one less concurrent statement */\n\t\t\t\t\t\t\t\t--stat_statements;\n\n\t\t\t\t\t\t\t\tconn->status = idle;\n\n\t\t\t\t\t\t\t\t/* remember execution time for statistics */\n\t\t\t\t\t\t\t\tif (-1 == gettimeofday(&delta, NULL)) {\n\t\t\t\t\t\t\t\t\tperror(\"Error calling gettimeofday\");\n\t\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t/* subtract statement start time */\n\t\t\t\t\t\t\t\t\ttimersub(&delta, &(conn->stmt_start), &delta);\n\n\t\t\t\t\t\t\t\t\t/* add to duration histogram */\n\t\t\t\t\t\t\t\t\tif (0 == delta.tv_sec) {\n\t\t\t\t\t\t\t\t\t\tif (20000 >= delta.tv_usec) {\n\t\t\t\t\t\t\t\t\t\t\t++stat_hist[0];\n\t\t\t\t\t\t\t\t\t\t} else if (100000 >= delta.tv_usec) {\n\t\t\t\t\t\t\t\t\t\t\t++stat_hist[1];\n\t\t\t\t\t\t\t\t\t\t} else if (500000 >= delta.tv_usec) {\n\t\t\t\t\t\t\t\t\t\t\t++stat_hist[2];\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t++stat_hist[3];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else if (2 > delta.tv_sec) {\n\t\t\t\t\t\t\t\t\t\t++stat_hist[3];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t++stat_hist[4];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t/* remember longest statement */\n\t\t\t\t\t\t\t\t\tif ((delta.tv_sec > stat_longstmt.tv_sec)\n\t\t\t\t\t\t\t\t\t\t|| ((delta.tv_sec == stat_longstmt.tv_sec)\n\t\t\t\t\t\t\t\t\t\t\t&& (delta.tv_usec > stat_longstmt.tv_usec)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstat_longstmt.tv_sec = delta.tv_sec;\n\t\t\t\t\t\t\t\t\t\tstat_longstmt.tv_usec = delta.tv_usec;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t/* add to total */\n\t\t\t\t\t\t\t\t\ttimeradd(&stat_exec, &delta, &stat_exec);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (! found_conn) {\n\t\t\t/* remember previous item in list, useful for removing an item */\n\t\t\tprev_conn = conn;\n\t\t}\n\n\t\tconn = conn->next;\n\t}\n\n\t/* make sure we found a connection above (except for connect items) */\n\tif (1 == rc) {\n\t\tif ((pg_connect == type) && (NULL != found_conn)) {\n\t\t\tfprintf(stderr, \"Error: connection for session 0x\" UINT64_FORMAT \" already exists\\n\", replay_get_session_id(item));\n\t\t\trc = -1;\n\t\t} else if ((pg_connect != type) && (NULL == found_conn)) {\n\t\t\tfprintf(stderr, \"Error: no connection found for session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\t\t\trc = -1;\n\t\t}\n\t}\n\n\t/* time when the statement originally ran */\n\tstmt_time = replay_get_time(item);\n\tlast_stmt_time.tv_sec = stmt_time->tv_sec;\n\tlast_stmt_time.tv_usec = stmt_time->tv_usec;\n\n\t/* set first_stmt_time if it is not yet set */\n\tif (! fstmtm_set) {\n\t\tfirst_stmt_time.tv_sec = stmt_time->tv_sec;\n\t\tfirst_stmt_time.tv_usec = stmt_time->tv_usec;\n\n\t\tfstmtm_set = 1;\n\t}\n\n\t/* get current time */\n\tif (-1 != rc) {\n\t\tif (-1 == gettimeofday(&now, NULL)) {\n\t\t\tfprintf(stderr, \"Error: gettimeofday failed\\n\");\n\t\t\trc = -1;\n\t\t}\n\t}\n\n\t/* determine if statement should already be consumed, sleep if necessary */\n\tif (-1 != rc) {\n\t\t/* calculate \"target time\" when item should be replayed:\n\t\t                                       statement time - first statement time\n\t\t   program start time - skipped time + -------------------------------------\n\t\t                                                   replay factor            */\n\n\t\t/* timestamp of the statement */\n\t\ttarget_time.tv_sec = stmt_time->tv_sec;\n\t\ttarget_time.tv_usec = stmt_time->tv_usec;\n\n\t\t/* subtract time of first statement */\n\t\ttimersub(&target_time, &first_stmt_time, &target_time);\n\n\t\t/* subtract skipped time */\n\t\tif (jump_enabled) {\n\t\t\ttimersub(&target_time, &jump_total, &target_time);\n\t\t}\n\n\t\t/* divide by replay_factor */\n\t\tif (replay_factor != 1.0) {\n\t\t\t/* - divide the seconds part by the factor\n\t\t\t   - divide the microsecond part by the factor and add the\n\t\t\t     fractional part (times 10^6) of the previous division\n\t\t\t   - if the result exceeds 10^6, subtract the excess and\n\t\t\t     add its 10^6th to the seconds part. */\n\t\t\td = target_time.tv_sec / replay_factor;\n\t\t\ttarget_time.tv_sec = d;\n\t\t\ttarget_time.tv_usec = target_time.tv_usec / replay_factor +\n\t\t\t\t(d - target_time.tv_sec) * 1000000.0;\n\t\t\ti = target_time.tv_usec / 1000000;\n\t\t\ttarget_time.tv_usec -= i * 1000000;\n\t\t\ttarget_time.tv_sec += i;\n\t\t}\n\n\t\t/* add program start time */\n\t\ttimeradd(&target_time, &start_time, &target_time);\n\n\t\t/* warn if we fall behind too much */\n\t\tif (secs_behind < now.tv_sec - target_time.tv_sec) {\n\t\t\tsecs_behind = now.tv_sec - target_time.tv_sec;\n\t\t\tfor (j=0; j<NUM_DELAY_STEPS; ++j) {\n\t\t\t\tif (! delay_steps[j].shown && delay_steps[j].seconds <= secs_behind) {\n\t\t\t\t\tprintf(\"Execution is %s behind schedule\\n\", delay_steps[j].display);\n\t\t\t\t\tfflush(stdout);\n\t\t\t\t\tdelay_steps[j].shown = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (((target_time.tv_sec > now.tv_sec) ||\n\t\t\t\t((target_time.tv_sec == now.tv_sec) && (target_time.tv_usec > now.tv_usec))) &&\n\t\t\t\tall_idle) {\n\t\t\t/* sleep or jump if all is idle and the target time is in the future */\n\n\t\t\t/* calculate time to sleep or jump (delta = target_time - now) */\n\t\t\ttimersub(&target_time, &now, &delta);\n\n\t\t\tif (jump_enabled) {\n\t\t\t\t/* add the sleep time to jump_total */\n\t\t\t\ttimeradd(&jump_total, &delta, &jump_total);\n\t\t\t\tdebug(2, \"Skipping %lu.%06lu seconds\\n\", (unsigned long)delta.tv_sec, (unsigned long)delta.tv_usec);\n\t\t\t\t/* then consume item */\n\t\t\t\trc = 1;\n\t\t\t} else {\n\t\t\t\t/* sleep */\n\t\t\t\tif (-1 == do_sleep(&delta)) {\n\t\t\t\t\trc = -1;\n\t\t\t\t} else {\n\t\t\t\t\t/* then consume item */\n\t\t\t\t\trc = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (((target_time.tv_sec < now.tv_sec) ||\n\t\t\t\t((target_time.tv_sec == now.tv_sec) && (target_time.tv_usec <= now.tv_usec))) &&\n\t\t\t\t((pg_connect == type) ||\n\t\t\t\t((pg_disconnect == type) && (closed == found_conn->status)) ||\n\t\t\t\t((pg_cancel == type) && (wait_read == found_conn->status)) ||\n\t\t\t\t(idle == found_conn->status))) {\n\t\t\t/* if the item is due and its connection is idle, consume it */\n\t\t\t/* cancel items will also be consumed if the connection is waiting for a resonse */\n\t\t\trc = 1;\n\t\t} else if (found_conn && (closed == found_conn->status)) {\n\t\t\tfprintf(stderr, \"Connection 0x\" UINT64_FORMAT \" failed with FATAL error: %s\\n\",\n\t\t\t\tfound_conn->session_id, found_conn->errmsg);\n\t\t\trc = -1;\n\t\t}\n\t}\n\n\t/* send statement */\n\tif (1 == rc) {\n\t\t/* count for statistics */\n\t\t++stat_actions;\n\n\t\tswitch (type) {\n\t\t\tcase pg_connect:\n\t\t\t\tdebug(2, \"Starting database connection for session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\n\t\t\t\t/* allocate a connect string */\n\t\t\t\tuser = replay_get_user(item);\n\t\t\t\tdatabase = replay_get_database(item);\n\t\t\t\tif (NULL == (connstr = malloc(strlen(conn_string) + 2 * strlen(user) + 2 * strlen(database) + 18))) {\n\t\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(conn_string) + 2 * strlen(user) + 2 * strlen(database) + 18);\n\t\t\t\t\trc = -1;\n\t\t\t\t} else {\n\t\t\t\t\t/* append user and password */\n\t\t\t\t\tstrcpy(connstr, conn_string);\n\t\t\t\t\tp1 = connstr + strlen(connstr);\n\t\t\t\t\t*(p1++) = ' ';\n\t\t\t\t\t*(p1++) = 'u';\n\t\t\t\t\t*(p1++) = 's';\n\t\t\t\t\t*(p1++) = 'e';\n\t\t\t\t\t*(p1++) = 'r';\n\t\t\t\t\t*(p1++) = '=';\n\t\t\t\t\t*(p1++) = '\\'';\n\t\t\t\t\tfor (p=user; '\\0'!=*p; ++p) {\n\t\t\t\t\t\tif (('\\'' == *p) || ('\\\\' == *p)) {\n\t\t\t\t\t\t\t*(p1++) = '\\\\';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*(p1++) = *p;\n\t\t\t\t\t}\n\t\t\t\t\t*(p1++) = '\\'';\n\t\t\t\t\t*(p1++) = ' ';\n\t\t\t\t\t*(p1++) = 'd';\n\t\t\t\t\t*(p1++) = 'b';\n\t\t\t\t\t*(p1++) = 'n';\n\t\t\t\t\t*(p1++) = 'a';\n\t\t\t\t\t*(p1++) = 'm';\n\t\t\t\t\t*(p1++) = 'e';\n\t\t\t\t\t*(p1++) = '=';\n\t\t\t\t\t*(p1++) = '\\'';\n\t\t\t\t\tfor (p=database; '\\0'!=*p; ++p) {\n\t\t\t\t\t\tif (('\\'' == *p) || ('\\\\' == *p)) {\n\t\t\t\t\t\t\t*(p1++) = '\\\\';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*(p1++) = *p;\n\t\t\t\t\t}\n\t\t\t\t\t*(p1++) = '\\'';\n\t\t\t\t\t*p1 = '\\0';\n\n\t\t\t\t\t/* allocate a struct dbconn */\n\t\t\t\t\tif (NULL == (found_conn = malloc(sizeof(struct dbconn)))) {\n\t\t\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)sizeof(struct dbconn));\n\t\t\t\t\t\trc = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* getaddrinfo() may set errno */\n\t\t\t\t\t\terrno = 0;\n\t\t\t\t\t\t/* initialize a connection */\n\t\t\t\t\t\tif (NULL == (found_conn->db_conn = PQconnectStart(connstr))) {\n\t\t\t\t\t\t\tfprintf(stderr, \"Cannot allocate memory for database connection\\n\");\n\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\tfree(found_conn);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (CONNECTION_BAD == PQstatus(found_conn->db_conn)) {\n\t\t\t\t\t\t\t\tfprintf(stderr, \"Error: connection to database failed: %s\\n\", PQerrorMessage(found_conn->db_conn));\n\t\t\t\t\t\t\t\tif (errno)\n\t\t\t\t\t\t\t\t\tfprintf(stderr, \"Error detail: %s\\n\", strerror(errno));\n\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\t\tPQfinish(found_conn->db_conn);\n\t\t\t\t\t\t\t\tfree(found_conn);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (-1 == (found_conn->socket = PQsocket(found_conn->db_conn))) {\n\t\t\t\t\t\t\t\t\tfprintf(stderr, \"Error: cannot get socket for database connection\\n\");\n\t\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\t\t\tPQfinish(found_conn->db_conn);\n\t\t\t\t\t\t\t\t\tfree(found_conn);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t/* set values in struct dbconn */\n\n\t\t\t\t\t\t\t\t\tfound_conn->session_id = replay_get_session_id(item);\n\t\t\t\t\t\t\t\t\tfound_conn->status = conn_wait_write;\n\t\t\t\t\t\t\t\t\tfound_conn->errmsg = NULL;\n\t\t\t\t\t\t\t\t\tfound_conn->next = connections;\n\n\t\t\t\t\t\t\t\t\tconnections = found_conn;\n\n\t\t\t\t\t\t\t\t\t/* do not display notices */\n\t\t\t\t\t\t\t\t\tPQsetNoticeReceiver(found_conn->db_conn, ignore_notices, NULL);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/* free connection sting */\n\t\t\t\t\tfree(connstr);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_disconnect:\n\t\t\t\t/* dead connections need not be closed */\n\t\t\t\tif (closed == found_conn->status) {\n\t\t\t\t\tdebug(2, \"Removing closed session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\t\t\t\t} else {\n\t\t\t\t\tdebug(2, \"Disconnecting database connection for session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\n\t\t\t\t\tPQfinish(found_conn->db_conn);\n\n\t\t\t\t\t/* remember session duration for statistics */\n\t\t\t\t\tif (-1 == gettimeofday(&delta, NULL)) {\n\t\t\t\t\t\tperror(\"Error calling gettimeofday\");\n\t\t\t\t\t\trc = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* subtract session start time */\n\t\t\t\t\t\ttimersub(&delta, &(found_conn->session_start), &delta);\n\n\t\t\t\t\t\t/* add to total */\n\t\t\t\t\t\ttimeradd(&stat_session, &delta, &stat_session);\n\t\t\t\t\t}\n\n\t\t\t\t\t/* one less concurrent session */\n\t\t\t\t\t--stat_sessions;\n\t\t\t\t}\n\n\t\t\t\t/* remove struct dbconn from linked list */\n\t\t\t\tif (prev_conn) {\n\t\t\t\t\tprev_conn->next = found_conn->next;\n\t\t\t\t} else {\n\t\t\t\t\tconnections = found_conn->next;\n\t\t\t\t}\n\t\t\t\tif (found_conn->errmsg) {\n\t\t\t\t\tfree(found_conn->errmsg);\n\t\t\t\t}\n\t\t\t\tfree(found_conn);\n\n\t\t\t\tbreak;\n\t\t\tcase pg_execute:\n\t\t\t\tdebug(2, \"Sending simple statement on session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\n\t\t\t\tif (! PQsendQuery(found_conn->db_conn, replay_get_statement(item))) {\n\t\t\t\t\tfprintf(stderr, \"Error sending simple statement: %s\\n\", PQerrorMessage(found_conn->db_conn));\n\t\t\t\t\trc = -1;\n\t\t\t\t} else {\n\t\t\t\t\tfound_conn->status = wait_write;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_prepare:\n\t\t\t\tdebug(2, \"Sending prepare request on session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\n\t\t\t\t/* count preparations for statistics */\n\t\t\t\t++stat_prep;\n\n\t\t\t\tif (! PQsendPrepare(\n\t\t\t\t\t\tfound_conn->db_conn,\n\t\t\t\t\t\treplay_get_name(item),\n\t\t\t\t\t\treplay_get_statement(item),\n\t\t\t\t\t\t0,\n\t\t\t\t\t\tNULL)) {\n\t\t\t\t\tfprintf(stderr, \"Error sending prepare request: %s\\n\", PQerrorMessage(found_conn->db_conn));\n\t\t\t\t\trc = -1;\n\t\t\t\t} else {\n\t\t\t\t\tfound_conn->status = wait_write;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_exec_prepared:\n\t\t\t\tdebug(2, \"Sending prepared statement execution on session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\n\t\t\t\tif (! PQsendQueryPrepared(\n\t\t\t\t\t\tfound_conn->db_conn,\n\t\t\t\t\t\treplay_get_name(item),\n\t\t\t\t\t\treplay_get_valuecount(item),\n\t\t\t\t\t\treplay_get_values(item),\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t0)) {\n\t\t\t\t\tfprintf(stderr, \"Error sending prepared statement execution: %s\\n\", PQerrorMessage(found_conn->db_conn));\n\t\t\t\t\trc = -1;\n\t\t\t\t} else {\n\t\t\t\t\tfound_conn->status = wait_write;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_cancel:\n\t\t\t\tdebug(2, \"Sending cancel request on session 0x\" UINT64_FORMAT \"\\n\", replay_get_session_id(item));\n\n\t\t\t\tif (NULL == (cancel_request = PQgetCancel(found_conn->db_conn))) {\n\t\t\t\t\tfprintf(stderr, \"Error creating cancel request\\n\");\n\t\t\t\t\trc = -1;\n\t\t\t\t} else {\n\t\t\t\t\tif (! PQcancel(cancel_request, errbuf, 256)) {\n\t\t\t\t\t\tfprintf(stderr, \"Error sending cancel request: %s\\n\", errbuf);\n\t\t\t\t\t\trc = -1;\n\t\t\t\t\t}\n\t\t\t\t\t/* free cancel request */\n\t\t\t\t\tPQfreeCancel(cancel_request);\n\t\t\t\t}\n\t\t\t\t/* status remains unchanged */\n\t\t\t\tbreak;\n\t\t}\n\n\t\treplay_free(item);\n\t}\n\n\t/* try to flush the statement if necessary */\n\tif ((1 == rc) && (pg_disconnect != type) && (wait_write == found_conn->status)) {\n\t\tswitch (PQflush(found_conn->db_conn)) {\n\t\t\tcase 0:\n\t\t\t\t/* complete request sent */\n\t\t\t\tfound_conn->status = wait_read;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tdebug(2, \"Session 0x\" UINT64_FORMAT \" needs to flush again\\n\", found_conn->session_id);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfprintf(stderr, \"Error flushing to database: %s\\n\", PQerrorMessage(found_conn->db_conn));\n\t\t\t\trc = -1;\n\t\t}\n\n\t\t/* get statement start time */\n\t\tif (-1 == gettimeofday(&(found_conn->stmt_start), NULL)) {\n\t\t\tperror(\"Error calling gettimeofday\");\n\t\t\trc = -1;\n\t\t}\n\n\t\t/* count concurrent statements */\n\t\tif (++stat_statements > stat_stmtmax) {\n\t\t\tstat_stmtmax = stat_statements;\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving database_consumer%s\\n\", \"\");\n\treturn rc;\n}\n\nint database_consumer_dry_run(replay_item *item) {\n\tconst replay_type type = replay_get_type(item);\n\tdebug(3, \"Entering database_consumer_dry_run%s\\n\", \"\");\n\tconst struct timeval *stmt_time;\n\tstatic int fstmt_set_dr = 0;\n\n\t/* time when the statement originally ran */\n\tstmt_time = replay_get_time(item);\n\tlast_stmt_time.tv_sec = stmt_time->tv_sec;\n\tlast_stmt_time.tv_usec = stmt_time->tv_usec;\n\n\t/* set first_stmt_time if it is not yet set */\n\tif (! fstmt_set_dr) {\n\t\tfirst_stmt_time.tv_sec = stmt_time->tv_sec;\n\t\tfirst_stmt_time.tv_usec = stmt_time->tv_usec;\n\n\t\tfstmt_set_dr = 1;\n\t}\n\n\t/* gather statistics */\n\t++stat_actions;\n\n\tswitch (type) {\n\t\tcase pg_connect:\n\t\t\t++stat_sesscnt;\n\t\t\tif (++stat_sessions > stat_sessmax) {\n\t\t\t\tstat_sessmax = stat_sessions;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase pg_disconnect:\n\t\t\t--stat_sessions;\n\t\t\tbreak;\n\t\tcase pg_execute:\n\t\tcase pg_exec_prepared:\n\t\t\t++stat_stmt;\n\t\t\tbreak;\n\t\tcase pg_prepare:\n\t\t\t++stat_prep;\n\t\t\tbreak;\n\t\tcase pg_cancel:\n\t\t\tbreak;\n\t}\n\n\treplay_free(item);\n\tdebug(3, \"Leaving database_consumer_dry_run%s\\n\", \"\");\n\n\treturn 1;\n}\n"
  },
  {
    "path": "install-sh",
    "content": "#!/bin/sh\n# install - install a program, script, or datafile\n\nscriptversion=2009-04-28.21; # UTC\n\n# This originates from X11R5 (mit/util/scripts/install.sh), which was\n# later released in X11R6 (xc/config/util/install.sh) with the\n# following copyright and license.\n#\n# Copyright (C) 1994 X Consortium\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to\n# deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n# sell copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-\n# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n#\n# Except as contained in this notice, the name of the X Consortium shall not\n# be used in advertising or otherwise to promote the sale, use or other deal-\n# ings in this Software without prior written authorization from the X Consor-\n# tium.\n#\n#\n# FSF changes to this file are in the public domain.\n#\n# Calling this script install-sh is preferred over install.sh, to prevent\n# `make' implicit rules from creating a file called install from it\n# when there is no Makefile.\n#\n# This script is compatible with the BSD install script, but was written\n# from scratch.\n\nnl='\n'\nIFS=\" \"\"\t$nl\"\n\n# set DOITPROG to echo to test this script\n\n# Don't use :- since 4.3BSD and earlier shells don't like it.\ndoit=${DOITPROG-}\nif test -z \"$doit\"; then\n  doit_exec=exec\nelse\n  doit_exec=$doit\nfi\n\n# Put in absolute file names if you don't have them in your path;\n# or use environment vars.\n\nchgrpprog=${CHGRPPROG-chgrp}\nchmodprog=${CHMODPROG-chmod}\nchownprog=${CHOWNPROG-chown}\ncmpprog=${CMPPROG-cmp}\ncpprog=${CPPROG-cp}\nmkdirprog=${MKDIRPROG-mkdir}\nmvprog=${MVPROG-mv}\nrmprog=${RMPROG-rm}\nstripprog=${STRIPPROG-strip}\n\nposix_glob='?'\ninitialize_posix_glob='\n  test \"$posix_glob\" != \"?\" || {\n    if (set -f) 2>/dev/null; then\n      posix_glob=\n    else\n      posix_glob=:\n    fi\n  }\n'\n\nposix_mkdir=\n\n# Desired mode of installed file.\nmode=0755\n\nchgrpcmd=\nchmodcmd=$chmodprog\nchowncmd=\nmvcmd=$mvprog\nrmcmd=\"$rmprog -f\"\nstripcmd=\n\nsrc=\ndst=\ndir_arg=\ndst_arg=\n\ncopy_on_change=false\nno_target_directory=\n\nusage=\"\\\nUsage: $0 [OPTION]... [-T] SRCFILE DSTFILE\n   or: $0 [OPTION]... SRCFILES... DIRECTORY\n   or: $0 [OPTION]... -t DIRECTORY SRCFILES...\n   or: $0 [OPTION]... -d DIRECTORIES...\n\nIn the 1st form, copy SRCFILE to DSTFILE.\nIn the 2nd and 3rd, copy all SRCFILES to DIRECTORY.\nIn the 4th, create DIRECTORIES.\n\nOptions:\n     --help     display this help and exit.\n     --version  display version info and exit.\n\n  -c            (ignored)\n  -C            install only if different (preserve the last data modification time)\n  -d            create directories instead of installing files.\n  -g GROUP      $chgrpprog installed files to GROUP.\n  -m MODE       $chmodprog installed files to MODE.\n  -o USER       $chownprog installed files to USER.\n  -s            $stripprog installed files.\n  -t DIRECTORY  install into DIRECTORY.\n  -T            report an error if DSTFILE is a directory.\n\nEnvironment variables override the default commands:\n  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG\n  RMPROG STRIPPROG\n\"\n\nwhile test $# -ne 0; do\n  case $1 in\n    -c) ;;\n\n    -C) copy_on_change=true;;\n\n    -d) dir_arg=true;;\n\n    -g) chgrpcmd=\"$chgrpprog $2\"\n\tshift;;\n\n    --help) echo \"$usage\"; exit $?;;\n\n    -m) mode=$2\n\tcase $mode in\n\t  *' '* | *'\t'* | *'\n'*\t  | *'*'* | *'?'* | *'['*)\n\t    echo \"$0: invalid mode: $mode\" >&2\n\t    exit 1;;\n\tesac\n\tshift;;\n\n    -o) chowncmd=\"$chownprog $2\"\n\tshift;;\n\n    -s) stripcmd=$stripprog;;\n\n    -t) dst_arg=$2\n\tshift;;\n\n    -T) no_target_directory=true;;\n\n    --version) echo \"$0 $scriptversion\"; exit $?;;\n\n    --)\tshift\n\tbreak;;\n\n    -*)\techo \"$0: invalid option: $1\" >&2\n\texit 1;;\n\n    *)  break;;\n  esac\n  shift\ndone\n\nif test $# -ne 0 && test -z \"$dir_arg$dst_arg\"; then\n  # When -d is used, all remaining arguments are directories to create.\n  # When -t is used, the destination is already specified.\n  # Otherwise, the last argument is the destination.  Remove it from $@.\n  for arg\n  do\n    if test -n \"$dst_arg\"; then\n      # $@ is not empty: it contains at least $arg.\n      set fnord \"$@\" \"$dst_arg\"\n      shift # fnord\n    fi\n    shift # arg\n    dst_arg=$arg\n  done\nfi\n\nif test $# -eq 0; then\n  if test -z \"$dir_arg\"; then\n    echo \"$0: no input file specified.\" >&2\n    exit 1\n  fi\n  # It's OK to call `install-sh -d' without argument.\n  # This can happen when creating conditional directories.\n  exit 0\nfi\n\nif test -z \"$dir_arg\"; then\n  trap '(exit $?); exit' 1 2 13 15\n\n  # Set umask so as not to create temps with too-generous modes.\n  # However, 'strip' requires both read and write access to temps.\n  case $mode in\n    # Optimize common cases.\n    *644) cp_umask=133;;\n    *755) cp_umask=22;;\n\n    *[0-7])\n      if test -z \"$stripcmd\"; then\n\tu_plus_rw=\n      else\n\tu_plus_rw='% 200'\n      fi\n      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;\n    *)\n      if test -z \"$stripcmd\"; then\n\tu_plus_rw=\n      else\n\tu_plus_rw=,u+rw\n      fi\n      cp_umask=$mode$u_plus_rw;;\n  esac\nfi\n\nfor src\ndo\n  # Protect names starting with `-'.\n  case $src in\n    -*) src=./$src;;\n  esac\n\n  if test -n \"$dir_arg\"; then\n    dst=$src\n    dstdir=$dst\n    test -d \"$dstdir\"\n    dstdir_status=$?\n  else\n\n    # Waiting for this to be detected by the \"$cpprog $src $dsttmp\" command\n    # might cause directories to be created, which would be especially bad\n    # if $src (and thus $dsttmp) contains '*'.\n    if test ! -f \"$src\" && test ! -d \"$src\"; then\n      echo \"$0: $src does not exist.\" >&2\n      exit 1\n    fi\n\n    if test -z \"$dst_arg\"; then\n      echo \"$0: no destination specified.\" >&2\n      exit 1\n    fi\n\n    dst=$dst_arg\n    # Protect names starting with `-'.\n    case $dst in\n      -*) dst=./$dst;;\n    esac\n\n    # If destination is a directory, append the input filename; won't work\n    # if double slashes aren't ignored.\n    if test -d \"$dst\"; then\n      if test -n \"$no_target_directory\"; then\n\techo \"$0: $dst_arg: Is a directory\" >&2\n\texit 1\n      fi\n      dstdir=$dst\n      dst=$dstdir/`basename \"$src\"`\n      dstdir_status=0\n    else\n      # Prefer dirname, but fall back on a substitute if dirname fails.\n      dstdir=`\n\t(dirname \"$dst\") 2>/dev/null ||\n\texpr X\"$dst\" : 'X\\(.*[^/]\\)//*[^/][^/]*/*$' \\| \\\n\t     X\"$dst\" : 'X\\(//\\)[^/]' \\| \\\n\t     X\"$dst\" : 'X\\(//\\)$' \\| \\\n\t     X\"$dst\" : 'X\\(/\\)' \\| . 2>/dev/null ||\n\techo X\"$dst\" |\n\t    sed '/^X\\(.*[^/]\\)\\/\\/*[^/][^/]*\\/*$/{\n\t\t   s//\\1/\n\t\t   q\n\t\t }\n\t\t /^X\\(\\/\\/\\)[^/].*/{\n\t\t   s//\\1/\n\t\t   q\n\t\t }\n\t\t /^X\\(\\/\\/\\)$/{\n\t\t   s//\\1/\n\t\t   q\n\t\t }\n\t\t /^X\\(\\/\\).*/{\n\t\t   s//\\1/\n\t\t   q\n\t\t }\n\t\t s/.*/./; q'\n      `\n\n      test -d \"$dstdir\"\n      dstdir_status=$?\n    fi\n  fi\n\n  obsolete_mkdir_used=false\n\n  if test $dstdir_status != 0; then\n    case $posix_mkdir in\n      '')\n\t# Create intermediate dirs using mode 755 as modified by the umask.\n\t# This is like FreeBSD 'install' as of 1997-10-28.\n\tumask=`umask`\n\tcase $stripcmd.$umask in\n\t  # Optimize common cases.\n\t  *[2367][2367]) mkdir_umask=$umask;;\n\t  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;\n\n\t  *[0-7])\n\t    mkdir_umask=`expr $umask + 22 \\\n\t      - $umask % 100 % 40 + $umask % 20 \\\n\t      - $umask % 10 % 4 + $umask % 2\n\t    `;;\n\t  *) mkdir_umask=$umask,go-w;;\n\tesac\n\n\t# With -d, create the new directory with the user-specified mode.\n\t# Otherwise, rely on $mkdir_umask.\n\tif test -n \"$dir_arg\"; then\n\t  mkdir_mode=-m$mode\n\telse\n\t  mkdir_mode=\n\tfi\n\n\tposix_mkdir=false\n\tcase $umask in\n\t  *[123567][0-7][0-7])\n\t    # POSIX mkdir -p sets u+wx bits regardless of umask, which\n\t    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.\n\t    ;;\n\t  *)\n\t    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$\n\t    trap 'ret=$?; rmdir \"$tmpdir/d\" \"$tmpdir\" 2>/dev/null; exit $ret' 0\n\n\t    if (umask $mkdir_umask &&\n\t\texec $mkdirprog $mkdir_mode -p -- \"$tmpdir/d\") >/dev/null 2>&1\n\t    then\n\t      if test -z \"$dir_arg\" || {\n\t\t   # Check for POSIX incompatibilities with -m.\n\t\t   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or\n\t\t   # other-writeable bit of parent directory when it shouldn't.\n\t\t   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.\n\t\t   ls_ld_tmpdir=`ls -ld \"$tmpdir\"`\n\t\t   case $ls_ld_tmpdir in\n\t\t     d????-?r-*) different_mode=700;;\n\t\t     d????-?--*) different_mode=755;;\n\t\t     *) false;;\n\t\t   esac &&\n\t\t   $mkdirprog -m$different_mode -p -- \"$tmpdir\" && {\n\t\t     ls_ld_tmpdir_1=`ls -ld \"$tmpdir\"`\n\t\t     test \"$ls_ld_tmpdir\" = \"$ls_ld_tmpdir_1\"\n\t\t   }\n\t\t }\n\t      then posix_mkdir=:\n\t      fi\n\t      rmdir \"$tmpdir/d\" \"$tmpdir\"\n\t    else\n\t      # Remove any dirs left behind by ancient mkdir implementations.\n\t      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null\n\t    fi\n\t    trap '' 0;;\n\tesac;;\n    esac\n\n    if\n      $posix_mkdir && (\n\tumask $mkdir_umask &&\n\t$doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\"\n      )\n    then :\n    else\n\n      # The umask is ridiculous, or mkdir does not conform to POSIX,\n      # or it failed possibly due to a race condition.  Create the\n      # directory the slow way, step by step, checking for races as we go.\n\n      case $dstdir in\n\t/*) prefix='/';;\n\t-*) prefix='./';;\n\t*)  prefix='';;\n      esac\n\n      eval \"$initialize_posix_glob\"\n\n      oIFS=$IFS\n      IFS=/\n      $posix_glob set -f\n      set fnord $dstdir\n      shift\n      $posix_glob set +f\n      IFS=$oIFS\n\n      prefixes=\n\n      for d\n      do\n\ttest -z \"$d\" && continue\n\n\tprefix=$prefix$d\n\tif test -d \"$prefix\"; then\n\t  prefixes=\n\telse\n\t  if $posix_mkdir; then\n\t    (umask=$mkdir_umask &&\n\t     $doit_exec $mkdirprog $mkdir_mode -p -- \"$dstdir\") && break\n\t    # Don't fail if two instances are running concurrently.\n\t    test -d \"$prefix\" || exit 1\n\t  else\n\t    case $prefix in\n\t      *\\'*) qprefix=`echo \"$prefix\" | sed \"s/'/'\\\\\\\\\\\\\\\\''/g\"`;;\n\t      *) qprefix=$prefix;;\n\t    esac\n\t    prefixes=\"$prefixes '$qprefix'\"\n\t  fi\n\tfi\n\tprefix=$prefix/\n      done\n\n      if test -n \"$prefixes\"; then\n\t# Don't fail if two instances are running concurrently.\n\t(umask $mkdir_umask &&\n\t eval \"\\$doit_exec \\$mkdirprog $prefixes\") ||\n\t  test -d \"$dstdir\" || exit 1\n\tobsolete_mkdir_used=true\n      fi\n    fi\n  fi\n\n  if test -n \"$dir_arg\"; then\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dst\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dst\"; } &&\n    { test \"$obsolete_mkdir_used$chowncmd$chgrpcmd\" = false ||\n      test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dst\"; } || exit 1\n  else\n\n    # Make a couple of temp file names in the proper directory.\n    dsttmp=$dstdir/_inst.$$_\n    rmtmp=$dstdir/_rm.$$_\n\n    # Trap to clean up those temp files at exit.\n    trap 'ret=$?; rm -f \"$dsttmp\" \"$rmtmp\" && exit $ret' 0\n\n    # Copy the file name to the temp name.\n    (umask $cp_umask && $doit_exec $cpprog \"$src\" \"$dsttmp\") &&\n\n    # and set any options; do chmod last to preserve setuid bits.\n    #\n    # If any of these fail, we abort the whole thing.  If we want to\n    # ignore errors from any of these, just make sure not to ignore\n    # errors from the above \"$doit $cpprog $src $dsttmp\" command.\n    #\n    { test -z \"$chowncmd\" || $doit $chowncmd \"$dsttmp\"; } &&\n    { test -z \"$chgrpcmd\" || $doit $chgrpcmd \"$dsttmp\"; } &&\n    { test -z \"$stripcmd\" || $doit $stripcmd \"$dsttmp\"; } &&\n    { test -z \"$chmodcmd\" || $doit $chmodcmd $mode \"$dsttmp\"; } &&\n\n    # If -C, don't bother to copy if it wouldn't change the file.\n    if $copy_on_change &&\n       old=`LC_ALL=C ls -dlL \"$dst\"\t2>/dev/null` &&\n       new=`LC_ALL=C ls -dlL \"$dsttmp\"\t2>/dev/null` &&\n\n       eval \"$initialize_posix_glob\" &&\n       $posix_glob set -f &&\n       set X $old && old=:$2:$4:$5:$6 &&\n       set X $new && new=:$2:$4:$5:$6 &&\n       $posix_glob set +f &&\n\n       test \"$old\" = \"$new\" &&\n       $cmpprog \"$dst\" \"$dsttmp\" >/dev/null 2>&1\n    then\n      rm -f \"$dsttmp\"\n    else\n      # Rename the file to the real destination.\n      $doit $mvcmd -f \"$dsttmp\" \"$dst\" 2>/dev/null ||\n\n      # The rename failed, perhaps because mv can't rename something else\n      # to itself, or perhaps because mv is so ancient that it does not\n      # support -f.\n      {\n\t# Now remove or move aside any old file at destination location.\n\t# We try this two ways since rm can't unlink itself on some\n\t# systems and the destination file might be busy for other\n\t# reasons.  In this case, the final cleanup might fail but the new\n\t# file should still install successfully.\n\t{\n\t  test ! -f \"$dst\" ||\n\t  $doit $rmcmd -f \"$dst\" 2>/dev/null ||\n\t  { $doit $mvcmd -f \"$dst\" \"$rmtmp\" 2>/dev/null &&\n\t    { $doit $rmcmd -f \"$rmtmp\" 2>/dev/null; :; }\n\t  } ||\n\t  { echo \"$0: cannot unlink or rename $dst\" >&2\n\t    (exit 1); exit 1\n\t  }\n\t} &&\n\n\t# Now rename the file to the real destination.\n\t$doit $mvcmd \"$dsttmp\" \"$dst\"\n      }\n    fi || exit 1\n\n    trap '' 0\n  fi\ndone\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"scriptversion=\"\n# time-stamp-format: \"%:y-%02m-%02d.%02H\"\n# time-stamp-time-zone: \"UTC\"\n# time-stamp-end: \"; # UTC\"\n# End:\n"
  },
  {
    "path": "main.c",
    "content": "#include \"pgreplay.h\"\n\n#include <stdio.h>\n#include <string.h>\n#include <unistd.h>\n#include <stdlib.h>\n#include <errno.h>\n#ifdef WINDOWS\n#\tinclude <windows.h>\n#endif\n\n/* from getopt */\nextern char *optarg;\n\nint debug_level = 0;\n\n/* destination of statistics output */\nFILE *sf;\n\n/* if 1, backslash will escape the following single quote in string literal */\nint backslash_quote = 0;\n\n/* if 1, replay will skip idle intervals instead of sleeping */\nint jump_enabled = 0;\n\n/* extra connect options specified with the -X option */\nchar *extra_connstr;\n\n/* wrapper for setenv, returns 0 on success and -1 on error */\nstatic int do_setenv(const char *name, const char *value) {\n\tint rc;\n\n#ifdef WINDOWS\n\tif (0 == SetEnvironmentVariable(name, value)) {\n\t\twin_perror(\"Error setting environment variable\", 0);\n\t\trc = -1;\n\t} else {\n\t\trc = 0;\n\t}\n#else\n\tif (-1 == (rc = setenv(name, value, 1))) {\n\t\tfprintf(stderr, \"Error setting environment variable\\n\");\n\t}\n#endif\n\n\treturn rc;\n}\n\nstatic void version(FILE *f) {\n\tfprintf(f, \"pgreplay %s\\n\", VERSION);\n}\n\nstatic void help(FILE *f) {\n\tfprintf(f, \"\\n\");\n\tversion(f);\n\tfprintf(f, \"==============\\n\");\n\tfprintf(f, \"\\nUsage: pgreplay [<parse options>] [<replay options>] [<infile>]\\n\");\n\tfprintf(f, \"       pgreplay -f [<parse options>] [-o <outfile>] [<infile>]\\n\");\n\tfprintf(f, \"       pgreplay -r [<replay options>] [<infile>]\\n\\n\");\n\tfprintf(f, \" The first form parses a PostgreSQL log file and replays the\\n\");\n\tfprintf(f, \"statements against a database.\\n\");\n\tfprintf(f, \" The second form parses a PostgreSQL log file and writes the\\n\");\n\tfprintf(f, \"contents to a \\\"replay file\\\" that can be replayed with -r.\\n\");\n\tfprintf(f, \" The third form replays a file generated with -f.\\n\\n\");\n\tfprintf(f, \"Parse options:\\n\");\n\tfprintf(f, \"   -c             (assume CSV logfile)\\n\");\n\tfprintf(f, \"   -b <timestamp> (start time for parsing logfile)\\n\");\n\tfprintf(f, \"   -e <timestamp> (end time for parsing logfile)\\n\");\n\tfprintf(f, \"   -q             ( \\\\' in string literal is a single quote)\\n\\n\");\n\tfprintf(f, \"   -D <database>  (database name to use as filter for parsing logfile)\\n\");\n\tfprintf(f, \"   -U <username>  (username to use as filter for parsing logfile)\\n\");\n\tfprintf(f, \"Replay options:\\n\");\n\tfprintf(f, \"   -h <hostname>\\n\");\n\tfprintf(f, \"   -p <port>\\n\");\n\tfprintf(f, \"   -W <password>  (must be the same for all users)\\n\");\n\tfprintf(f, \"   -s <factor>    (speed factor for replay)\\n\");\n\tfprintf(f, \"   -E <encoding>  (server encoding)\\n\");\n\tfprintf(f, \"   -j             (skip idle time during replay)\\n\");\n\tfprintf(f, \"   -X <options>   (extra libpq connect options)\\n\\n\");\n\tfprintf(f, \"   -n             (dry-run, will replay file without running queries)\\n\\n\");\n\tfprintf(f, \"Debugging:\\n\");\n\tfprintf(f, \"   -d <level>     (level between 1 and 3)\\n\");\n\tfprintf(f, \"   -v             (prints version and exits)\\n\");\n}\n\nint main(int argc, char **argv) {\n\tint arg, parse_only = 0, replay_only = 0, port = -1, csv = 0,\n\t\tparse_opt = 0, replay_opt = 0, rc = 0, dry_run = 0;\n\tdouble factor = 1.0;\n\tchar *host = NULL, *encoding = NULL, *endptr, *passwd = NULL,\n\t\t*outfilename = NULL, *infilename = NULL,\n\t\t*database_only = NULL, *username_only = NULL,\n\t\tstart_time[24] = { '\\0' }, end_time[24] = { '\\0' };\n\tconst char *errmsg;\n\tunsigned long portnr = 0l, debug = 0l, length;\n\treplay_item_provider *provider;\n\treplay_item_provider_init *provider_init;\n\treplay_item_provider_finish *provider_finish;\n\treplay_item_consumer *consumer;\n\treplay_item_consumer_init *consumer_init;\n\treplay_item_consumer_finish *consumer_finish;\n\treplay_item *item = NULL;\n\n\t/* initialize errno to avoid bogus error messages */\n\terrno = 0;\n\n\t/* parse arguments */\n\topterr = 0;\n\twhile (-1 != (arg = getopt(argc, argv, \"vfro:h:p:W:s:E:d:cb:e:qjnX:D:U:\"))) {\n\t\tswitch (arg) {\n\t\t\tcase 'v':\n\t\t\t\tversion(stdout);\n\t\t\t\treturn 0;\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\t\tparse_only = 1;\n\t\t\t\tif (replay_only) {\n\t\t\t\t\tfprintf(stderr, \"Error: options -p and -r are mutually exclusive\\n\");\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'r':\n\t\t\t\treplay_only = 1;\n\t\t\t\tif (parse_only) {\n\t\t\t\t\tfprintf(stderr, \"Error: options -p and -r are mutually exclusive\\n\");\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'o':\n\t\t\t\toutfilename = ('\\0' == *optarg) ? NULL : optarg;\n\t\t\t\tbreak;\n\t\t\tcase 'h':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\thost = ('\\0' == *optarg) ? NULL : optarg;\n\t\t\t\tbreak;\n\t\t\tcase 'p':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\tportnr = strtoul(optarg, &endptr, 0);\n\t\t\t\tif (('\\0' == *optarg) || ('\\0' != *endptr)) {\n\t\t\t\t\tfprintf(stderr, \"Not a valid port number: \\\"%s\\\"\\n\", optarg);\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tif ((portnr < 1) || (65535 < portnr)) {\n\t\t\t\t\tfprintf(stderr, \"Port number must be between 1 and 65535\\n\");\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tport = (int)portnr;\n\t\t\t\tbreak;\n\t\t\tcase 'W':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\tpasswd = ('\\0' == *optarg) ? NULL : optarg;\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\tfactor = strtod(optarg, &endptr);\n\t\t\t\tif (('\\0' == *optarg) || ('\\0' != *endptr)) {\n\t\t\t\t\tfprintf(stderr, \"Not a valid floating point number: \\\"%s\\\"\\n\", optarg);\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tif (0 != errno) {\n\t\t\t\t\tperror(\"Error converting speed factor\");\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tif (factor <= 0.0) {\n\t\t\t\t\tfprintf(stderr, \"Factor must be greater than 0\\n\");\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'E':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\tencoding = ('\\0' == *optarg) ? NULL : optarg;\n\t\t\t\tbreak;\n\t\t\tcase 'd':\n\t\t\t\tdebug = strtoul(optarg, &endptr, 0);\n\t\t\t\tif (('\\0' == *optarg) || ('\\0' != *endptr)) {\n\t\t\t\t\tfprintf(stderr, \"Not a valid debug level: \\\"%s\\\"\\n\", optarg);\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tif ((debug < 0) || (3 < debug)) {\n\t\t\t\t\tfprintf(stderr, \"Debug level must be between 0 and 3\\n\");\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tdebug_level = (int)debug;\n\t\t\t\tbreak;\n\t\t\tcase 'c':\n\t\t\t\tparse_opt = 1;\n\n\t\t\t\tcsv = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'b':\n\t\t\t\tparse_opt = 1;\n\n\t\t\t\tif (NULL == (errmsg = parse_time(optarg, NULL))) {\n\t\t\t\t\tstrncpy(start_time, optarg, 23);\n\t\t\t\t} else {\n\t\t\t\t\tfprintf(stderr, \"Error in begin timestamp: %s\\n\", errmsg);\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'e':\n\t\t\t\tparse_opt = 1;\n\n\t\t\t\tif (NULL == (errmsg = parse_time(optarg, NULL))) {\n\t\t\t\t\tstrncpy(end_time, optarg, 23);\n\t\t\t\t} else {\n\t\t\t\t\tfprintf(stderr, \"Error in end timestamp: %s\\n\", errmsg);\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'q':\n\t\t\t\tbackslash_quote = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'j':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\tjump_enabled = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'n':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\tdry_run = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'X':\n\t\t\t\treplay_opt = 1;\n\n\t\t\t\textra_connstr = optarg;\n\t\t\t\tbreak;\n\t\t\tcase 'D':\n\t\t\t\tparse_opt = 1;\n\n\t\t\t\tif (NULL == database_only) {\n\t\t\t\t\tlength = strlen(optarg) + 3;\n\t\t\t\t\tdatabase_only = malloc(length);\n\t\t\t\t\tif (NULL != database_only)\n\t\t\t\t\t\tstrcpy(database_only, \"\\\\\");\n\t\t\t\t} else {\n\t\t\t\t\tlength = strlen(database_only) + strlen(optarg) + 2;\n\t\t\t\t\tdatabase_only = realloc(database_only, length);\n\t\t\t\t}\n\t\t\t\tif (NULL == database_only) {\n\t\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", length);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\tstrcat(database_only, optarg);\n\t\t\t\tstrcat(database_only, \"\\\\\");\n\t\t\t\tbreak;\n\t\t\tcase 'U':\n\t\t\t\tparse_opt = 1;\n\n\t\t\t\tif (NULL == username_only) {\n\t\t\t\t\tlength = strlen(optarg) + 3;\n\t\t\t\t\tusername_only = malloc(length);\n\t\t\t\t\tif (NULL != username_only)\n\t\t\t\t\t\tstrcpy(username_only, \"\\\\\");\n\t\t\t\t} else {\n\t\t\t\t\tlength = strlen(username_only) + strlen(optarg) + 2;\n\t\t\t\t\tusername_only = realloc(username_only, length);\n\t\t\t\t}\n\t\t\t\tif (NULL == username_only) {\n\t\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", length);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\tstrcat(username_only, optarg);\n\t\t\t\tstrcat(username_only, \"\\\\\");\n\t\t\t\tbreak;\n\t\t\tcase '?':\n\t\t\t\tif (('?' == optopt) || ('h' == optopt)) {\n\t\t\t\t\thelp(stdout);\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\tfprintf(stderr, \"Error: unknown option -%c\\n\", optopt);\n\t\t\t\t\thelp(stderr);\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (optind + 1 < argc) {\n\t\tfprintf(stderr, \"More than one argument given\\n\");\n\t\thelp(stderr);\n\t\treturn 1;\n\t}\n\n\tif (optind + 1 == argc) {\n\t\tinfilename = argv[optind];\n\t}\n\n\tif (parse_only && replay_opt) {\n\t\tfprintf(stderr, \"Error: cannot specify replay option with -f\\n\");\n\t\thelp(stderr);\n\t\treturn 1;\n\t}\n\n\tif (replay_only && parse_opt) {\n\t\tfprintf(stderr, \"Error: cannot specify parse option with -r\\n\");\n\t\thelp(stderr);\n\t\treturn 1;\n\t}\n\n\tif (NULL != outfilename) {\n\t\tif (! parse_only) {\n\t\t\tfprintf(stderr, \"Error: option -o is only allowed with -f\\n\");\n\t\t\thelp(stderr);\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\t/* set default encoding */\n\tif (NULL != encoding) {\n\t\tif (-1 == do_setenv(\"PGCLIENTENCODING\", encoding)) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\t/* figure out destination for statistics output */\n\tif (parse_only && (NULL == outfilename)) {\n\t\tsf = stderr;  /* because replay file will go to stdout */\n\t} else {\n\t\tsf = stdout;\n\t}\n\n\t/* configure main loop */\n\n\tif (replay_only) {\n\t\tprovider_init = &file_provider_init;\n\t\tprovider = &file_provider;\n\t\tprovider_finish = &file_provider_finish;\n\t} else {\n\t\tprovider_init = &parse_provider_init;\n\t\tprovider = &parse_provider;\n\t\tprovider_finish = &parse_provider_finish;\n\t}\n\n\tif (parse_only) {\n\t\tconsumer_init = &file_consumer_init;\n\t\tconsumer_finish = &file_consumer_finish;\n\t\tconsumer = &file_consumer;\n\t} else {\n\t\tconsumer_init = &database_consumer_init;\n\t\tconsumer_finish = &database_consumer_finish;\n\t\tif (0 == dry_run) {\n\t\t\tconsumer = &database_consumer;\n\t\t} else {\n\t\t\tconsumer = &database_consumer_dry_run;\n\t\t}\n\t}\n\n\t/* main loop */\n\n\tif (! (*provider_init)(\n\t\t\tinfilename,\n\t\t\tcsv,\n\t\t\t(('\\0' == start_time[0]) ? NULL : start_time),\n\t\t\t(('\\0' == end_time[0]) ? NULL : end_time),\n\t\t\tdatabase_only,\n\t\t\tusername_only\n\t\t))\n\t{\n\t\trc = 1;\n\t}\n\n\tif ((0 == rc) && (*consumer_init)(outfilename, host, port, passwd, factor)) {\n\t\t/* try to get first item */\n\t\tif (! (item = (*provider)())) {\n\t\t\trc = 1;\n\t\t}\n\t} else {\n\t\trc = 1;\n\t}\n\n\twhile ((0 == rc) && (end_item != item)) {\n\t\tswitch ((*consumer)(item)) {\n\t\t\tcase 0:     /* item not consumed */\n\t\t\t\tbreak;\n\t\t\tcase 1:     /* item consumed */\n\t\t\t\tif (! (item = (*provider)())) {\n\t\t\t\t\trc = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:    /* error occurred */\n\t\t\t\trc = 1;\n\t\t}\n\t}\n\n\t/* no statistics output if there was an error */\n\tif (1 == rc) {\n\t\tsf = NULL;\n\t}\n\n\t(*provider_finish)();\n\t(*consumer_finish)(dry_run);\n\n\treturn rc;\n}\n"
  },
  {
    "path": "parse.c",
    "content": "#include \"pgreplay.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <stdint.h>\n#include <unistd.h>\n#include <string.h>\n#include <assert.h>\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n#ifdef TIME_WITH_SYS_TIME\n#\tinclude <sys/time.h>\n#\tinclude <time.h>\n#else\n#\tifdef HAVE_SYS_TIME_H\n#\t\tinclude <sys/time.h>\n#\telse\n#\t\tinclude <time.h>\n#\tendif\n#endif\n\n/* long enough to contain the beginning of a log line */\n#define BUFLEN 1024\n/* separates log line entries */\n#define SEPCHAR '|'\n\n/* types of log entries */\ntypedef enum {\n\tlog_debug5,\n\tlog_debug4,\n\tlog_debug3,\n\tlog_debug2,\n\tlog_debug1,\n\tlog_info,\n\tlog_notice,\n\tlog_warning,\n\tlog_error,\n\tlog_log,\n\tlog_fatal,\n\tlog_panic,\n\tlog_unknown\n} log_type;\n\n/* type for functions parsing the next log entry */\ntypedef int (parse_log_entry_func)(struct timeval *, char *, char *, uint64_t *, log_type *, char **, char **);\n/* functions for parsing stderr and CSV log entries */\nstatic parse_log_entry_func parse_errlog_entry;\nstatic parse_log_entry_func parse_csvlog_entry;\nstatic parse_log_entry_func * const parse_log_entry[2] = {\n\t&parse_errlog_entry,\n\t&parse_csvlog_entry\n};\n\n/* used to remember prepared statements */\nstruct prep_stmt {\n\tchar *name;\n\tstruct prep_stmt *next;\n};\n/* used to remember \"open\" connections */\nstruct connection {\n\tuint64_t session_id;\n\tstruct connection *next;\n\tstruct prep_stmt *statements;\n};\n/* hash structure for \"open\" connections */\nstatic struct connection * open_conn[256] = { NULL };\n\n/* indicates whether we are parsing a CSV file */\nstatic int csv;\n/* start and end timestamp for parsing log entries */\nstatic const char *start_time, *end_time;\n/* database and username filters for parsing log entries */\nstatic const char *database_only, *username_only;\n/* file which we parse */\nstatic int infile;\n/* line number for error messages */\nstatic unsigned long lineno = 0;\n/* offset for time values (what mktime(3) makes of 2000-01-01 00:00:00)\n   used to make timestamps independent of local time and broken mktime */\nstatic time_t epoch;\n/* time of the first and last statement that we parse */\nstatic struct timeval first_stmt_time, last_stmt_time;\n\n/* statistics */\nstatic unsigned long stat_simple = 0;     /* simple statements */\nstatic unsigned long stat_copy = 0;       /* copy statements */\nstatic unsigned long stat_param = 0;      /* parametrized statements */\nstatic unsigned long stat_named = 0;      /* different named statements */\nstatic unsigned long stat_execnamed = 0;  /* named statement executions */\nstatic unsigned long stat_fastpath = 0;   /* fast-path function calls */\nstatic unsigned long stat_cancel = 0;     /* cancel requests */\n\n/* a version of strcpy that handles overlapping strings well */\nstatic char *overlap_strcpy(char *dest, const char *src) {\n\tregister char c;\n\n\twhile((c = *(src++))) {\n\t\t*(dest++) = c;\n\t}\n\t*dest = '\\0';\n\n\treturn dest;\n}\n\n/* convert a string to a log_type */\nstatic log_type to_log_type(const char* s) {\n\t/* compare in order of expected likelyhood for performance */\n\tif (! strcmp(s, \"LOG\")) {\n\t\treturn log_log;\n\t} else if (! strcmp(s, \"ERROR\")) {\n\t\treturn log_error;\n\t} else if (! strcmp(s, \"STATEMENT\")) {\n\t\treturn log_unknown;\n\t} else if (! strcmp(s, \"DETAIL\")) {\n\t\treturn log_unknown;\n\t} else if (! strcmp(s, \"HINT\")) {\n\t\treturn log_unknown;\n\t} else if (! strcmp(s, \"FATAL\")) {\n\t\treturn log_fatal;\n\t} else if (! strcmp(s, \"WARNING\")) {\n\t\treturn log_warning;\n\t} else if (! strcmp(s, \"NOTICE\")) {\n\t\treturn log_notice;\n\t} else if (! strcmp(s, \"INFO\")) {\n\t\treturn log_info;\n\t} else if (! strcmp(s, \"PANIC\")) {\n\t\treturn log_panic;\n\t} else if (! strcmp(s, \"DEBUG1\")) {\n\t\treturn log_debug1;\n\t} else if (! strcmp(s, \"DEBUG2\")) {\n\t\treturn log_debug2;\n\t} else if (! strcmp(s, \"DEBUG3\")) {\n\t\treturn log_debug3;\n\t} else if (! strcmp(s, \"DEBUG4\")) {\n\t\treturn log_debug4;\n\t} else if (! strcmp(s, \"DEBUG5\")) {\n\t\treturn log_debug5;\n\t} else {\n\t\treturn log_unknown;\n\t}\n}\n\n/* Parses a timestamp (ignoring the time zone part).\n   If \"dest\" is not null, the parsed time will be returned there.\n   Return value is NULL on success, else an error message */\n\nconst char * parse_time(const char *source, struct timeval *dest) {\n\tint i;\n\tstatic struct tm tm;  /* initialize with zeros */\n\tchar s[24] = { '\\0' };  /* modifiable copy of source */\n\tstatic char errmsg[BUFLEN];\n\t/* format of timestamp part */\n\tstatic const char format[]=\"nnnn-nn-nn nn:nn:nn.nnn\";\n\n\t/* check timestamp for validity */\n\tif (!source) {\n\t\tstrcpy(errmsg, \"NULL passed as timestamp string\");\n\t\treturn errmsg;\n\t}\n\n\tif (strlen(source) < strlen(format)) {\n\t\tsprintf(errmsg, \"timestamp string is less than %lu characters long\", (unsigned long)strlen(format));\n\t\treturn errmsg;\n\t}\n\n\tif (strlen(source) >= BUFLEN) {\n\t\tsprintf(errmsg, \"timestamp string is more than %d characters long\", BUFLEN-1);\n\t\treturn errmsg;\n\t}\n\n\tfor (i=0; i<strlen(format); ++i) {\n\t\tswitch (format[i]) {\n\t\t\tcase 'n':\n\t\t\t\tif ((source[i] < '0') || (source[i] > '9')) {\n\t\t\t\t\tsprintf(errmsg, \"character %d in timestamp string is '%c', expected digit\", i+1, source[i]);\n\t\t\t\t\treturn errmsg;\n\t\t\t\t} else\n\t\t\t\t\ts[i] = source[i];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (source[i] != format[i]) {\n\t\t\t\t\tsprintf(errmsg, \"character %d in timestamp string is '%c', expected '%c'\", i+1, source[i], format[i]);\n\t\t\t\t\treturn errmsg;\n\t\t\t\t} else\n\t\t\t\t\ts[i] = '\\0';  /* tokenize parts */\n\t\t}\n\t}\n\n\t/* parse time into 'tm' */\n\ttm.tm_year  = atoi(s) - 1900;\n\ttm.tm_mon   = atoi(s + 5) - 1;\n\ttm.tm_mday  = atoi(s + 8);\n\ttm.tm_hour  = atoi(s + 11);\n\ttm.tm_min   = atoi(s + 14);\n\ttm.tm_sec   = atoi(s + 17);\n\ttm.tm_isdst = 0;  /* ignore daylight savings time */\n\n\tif (dest) {\n\t\tdest->tv_sec  = mktime(&tm) - epoch;\n\t\tdest->tv_usec = atoi(s + 20) * 1000;\n\t}\n\n\treturn NULL;\n}\n\nstatic char * parse_session(const char *source, uint64_t *dest) {\n\tchar s[BUFLEN];  /* modifiable copy of source */\n\tstatic char errmsg[BUFLEN];\n\tchar *s1 = NULL, c;\n\tuint32_t part1, part2;\n\tint i;\n\n\t/* check input for validity */\n\tif (!source) {\n\t\tstrcpy(errmsg, \"NULL passed as session id string\");\n\t\treturn errmsg;\n\t}\n\n\tif (strlen(source) > BUFLEN -1) {\n\t\tsprintf(errmsg, \"session id string is more than %d characters long\", BUFLEN);\n\t\treturn errmsg;\n\t}\n\n\tfor (i=0; i<=strlen(source); ++i) {\n\t\tc = source[i];\n\t\tif (('.' == c) && (! s1)) {\n\t\t\ts[i] = '\\0';\n\t\t\ts1 = s + i + 1;\n\t\t} else if (((c < '0') || (c > '9')) && ((c < 'a') || (c > 'f')) && ('\\0' != c)) {\n\t\t\tsprintf(errmsg, \"character %d in session id string is '%c', expected hex digit\", i+1, c);\n\t\t\treturn errmsg;\n\t\t} else\n\t\t\ts[i] = c;\n\t}\n\n\tif (! s1) {\n\t\tstrcpy(errmsg, \"Missing \\\".\\\" in session id string\");\n\t\treturn errmsg;\n\t}\n\n\tif ((strlen(s) > 8) || (strlen(s1) > 8)) {\n\t\tstrcpy(errmsg, \"none of the parts of a session id string may be longer than 8 hex digits\");\n\t\treturn errmsg;\n\t}\n\n\t/* convert both parts */\n\tsscanf(s, UINT32_FORMAT, &part1);\n\tsscanf(s1, UINT32_FORMAT, &part2);\n\t*dest = (((uint64_t)part1) << 32) + part2;\n\n\treturn NULL;\n}\n\n/* reads one log entry from the input file\n   the result is a malloc'ed string that must be freed\n   a return value of NULL means that there was an error */\n\nstatic char * read_log_line() {\n\tchar *line, buf[BUFLEN] = { '\\0' }, *p;\n\tint len, escaped = 0, nl_found = 0, line_size = 0, i, l;\n\tssize_t bytes_read;\n\t/* this will contain stuff we have read from the file but not used yet */\n\tstatic char peekbuf[BUFLEN] = { '\\0' };\n\tstatic int peeklen = 0;\n\n\tdebug(3, \"Entering read_log_line, current line number %lu\\n\", lineno+1);\n\n\t/* pre-allocate the result to length 1 */\n\tif (NULL == (line = malloc(1))) {\n\t\tfprintf(stderr, \"Cannot allocate 1 byte of memory\\n\");\n\t\treturn NULL;\n\t}\n\t*line = '\\0';\n\n\twhile (! nl_found) {\n\t\t/* if there were any chars left from the last invokation, use them first */\n\t\tlen = peeklen;\n\t\tif (len) {\n\t\t\tstrcpy(buf, peekbuf);\n\t\t\tpeekbuf[0] = '\\0';\n\t\t}\n\t\tpeeklen = 0;\n\n\t\t/* read from file until buf is full (at most) */\n\t\tif (len < BUFLEN - 1) {\n\t\t\tif (-1 == (bytes_read = read(infile, buf + len, BUFLEN - 1 - len))) {\n\t\t\t\tperror(\"Error reading from input file\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tlen += bytes_read;\n\t\t\tbuf[len] = '\\0';\n\t\t}\n\n\t\t/* if there is still nothing, we're done */\n\t\tif (0 == len) {\n\t\t\tdebug(2, \"Encountered EOF%s\\n\", \"\");\n\t\t\tdebug(3, \"Leaving read_log_line%s\\n\", \"\");\n\t\t\treturn line;\n\t\t}\n\n\t\t/* search the string for unescaped newlines */\n\t\tfor (p=buf; *p!='\\0'; ++p) {\n\t\t\tif (csv && ('\"' == *p)) {\n\t\t\t\tescaped = !escaped;\n\t\t\t}\n\t\t\t/* keep up with line count */\n\t\t\tlineno += ('\\n' == *p);\n\n\t\t\t/* look for unescaped newline */\n\t\t\tif (!escaped && ('\\n' == *p)) {\n\t\t\t\t/* if a newline is found, truncate the string\n\t\t\t\t   and prepend the rest to peekbuf */\n\t\t\t\tl = len - (++p - buf);\n\t\t\t\t/* right shift peekbuf by l */\n\t\t\t\tfor (i=peeklen; i>=0; --i) {\n\t\t\t\t\tpeekbuf[l+i] = peekbuf[i];\n\t\t\t\t}\n\t\t\t\tstrncpy(peekbuf, p, l);\n\t\t\t\t*p = '\\0';\n\t\t\t\tpeeklen += len - (p - buf);\n\t\t\t\tlen = p - buf;\n\t\t\t\tif (csv) {\n\t\t\t\t\t/* for a CSV file, this must be the end of the log entry */\n\t\t\t\t\tnl_found = 1;\n\t\t\t\t\tbreak;  /* out from the for loop */\n\t\t\t\t} else {\n\t\t\t\t\t/* in a stderr log file, we must check for a\n\t\t\t\t\t   continuation line (newline + tab) */\n\t\t\t\t\t/* first, make sure there is something to peek at */\n\t\t\t\t\tif (0 == peeklen) {\n\t\t\t\t\t\t/* try to read one more byte from the file */\n\t\t\t\t\t\tif (-1 == (bytes_read = read(infile, peekbuf, 1))) {\n\t\t\t\t\t\t\tperror(\"Error reading from input file\");\n\t\t\t\t\t\t\treturn NULL;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (0 == bytes_read) {\n\t\t\t\t\t\t\t/* EOF means end of log entry */\n\t\t\t\t\t\t\tnl_found = 1;\n\t\t\t\t\t\t\tbreak;  /* out from the for loop */\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpeeklen = bytes_read;\n\t\t\t\t\t\t\tpeekbuf[peeklen] = '\\0';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/* then check for a continuation tab */\n\t\t\t\t\tif ('\\t' == *peekbuf) {\n\t\t\t\t\t\t/* continuation line, remove tab\n\t\t\t\t\t\t   and copy peekbuf back to buf */\n\t\t\t\t\t\tstrncpy(p--, peekbuf + 1, BUFLEN - 1 - len);\n\t\t\t\t\t\tif (peeklen > BUFLEN - len) {\n\t\t\t\t\t\t\toverlap_strcpy(peekbuf, peekbuf + (BUFLEN - len));\n\t\t\t\t\t\t\tpeeklen = peeklen - BUFLEN + len;\n\t\t\t\t\t\t\tlen = BUFLEN - 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t*peekbuf = '\\0';\n\t\t\t\t\t\t\tlen += peeklen - 1;\n\t\t\t\t\t\t\tpeeklen = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbuf[len] = '\\0';\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* end of log entry reached */\n\t\t\t\t\t\tnl_found = 1;\n\t\t\t\t\t\tbreak;  /* out from the for loop */\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/* extend result line and append buf */\n\t\tline_size += len;\n\t\tif (NULL == (p = realloc(line, line_size+1))) {\n\t\t\tfprintf(stderr, \"Cannot allocate %d bytes of memory\\n\", line_size);\n\t\t\tfree(line); line = NULL;\n\t\t\treturn NULL;\n\t\t}\n\t\tline = p;\n\t\tstrcat(line, buf);\n\t\t*buf = '\\0';\n\t\tlen = 0;\n\t}\n\n\t/* remove trailing newline in result if present */\n\tif ('\\n' == line[line_size - 1]) {\n\t\tline[line_size - 1] = '\\0';\n\t}\n\n\tdebug(3, \"Leaving read_log_line%s\\n\", \"\");\n\n\treturn line;\n}\n\n/* parses the next stderr log entry (and maybe a detail message after that)\n   timestamp, user, database, session ID, log message type, log message\n   and detail message are returned in the respective parameters\n   \"message\" and \"detail\" are malloc'ed if they are not NULL\n   return values: -1 (error), 0 (end-of-file), or 1 (success) */\n\nstatic int parse_errlog_entry(struct timeval *time, char *user, char *database, uint64_t *session_id, log_type *type, char **message, char **detail) {\n\tchar *line = NULL, *part2, *part3, *part4, *part5, *part6;\n\tconst char *errmsg;\n\tint i, skip_line = 0;\n\tstatic int dump_found = 0;\n\t/* if not NULL, contains the next log entry to parse */\n\tstatic char* keepline = NULL;\n\n\tdebug(3, \"Entering parse_errlog_entry%s\\n\", \"\");\n\n\t/* initialize message and detail with NULL */\n\t*message = NULL;\n\t*detail = NULL;\n\n\t/* use cached line or read next line from log file */\n\tif (keepline) {\n\t\tline = keepline;\n\t\tkeepline = NULL;\n\t} else {\n\t\t/* read lines until we are between start_time and end_time */\n\t\tdo {\n\t\t\tif (line) {\n\t\t\t\tfree(line);\n\t\t\t}\n\t\t\tif (NULL == (line = read_log_line())) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t/* is it the start of a memory dump? */\n\t\t\tif (0 == strncmp(line, \"TopMemoryContext: \", 18)) {\n\t\t\t\tfprintf(stderr, \"Found memory dump in line %lu\\n\", lineno);\n\t\t\t\tdump_found = 1;\n\t\t\t\tskip_line = 1;\n\t\t\t} else {\n\t\t\t\t/* if there is a dump and the line starts blank,\n\t\t\t\t   assume the line is part of the dump\n\t\t\t\t*/\n\t\t\t\tif (dump_found && (' ' == *line)) {\n\t\t\t\t\tskip_line = 1;\n\t\t\t\t} else {\n\t\t\t\t\tskip_line = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (('\\0' != *line)\n\t\t\t&& (skip_line\n\t\t\t\t|| (start_time && (strncmp(line, start_time, 23) < 0))));\n\t}\n\n\t/* check for EOF */\n\tif (('\\0' == *line) || (end_time && (strncmp(line, end_time, 23) > 0))) {\n\t\tfree(line);\n\t\tdebug(3, \"Leaving parse_errlog_entry%s\\n\", \"\");\n\t\treturn 0;\n\t}\n\n\t/* split line on | in six pieces: time, user, database, session ID, log entry type, rest */\n\tif (NULL == (part2 = strchr(line, SEPCHAR))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: no \\\"%c\\\" found - log_line_prefix may be wrong\\n\", lineno, SEPCHAR);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\t*(part2++) = '\\0';\n\t}\n\n\tif (NULL == (part3 = strchr(part2, SEPCHAR))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: second \\\"%c\\\" not found - log_line_prefix may be wrong\\n\", lineno, SEPCHAR);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\t*(part3++) = '\\0';\n\t}\n\n\tif (NULL == (part4 = strchr(part3, SEPCHAR))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: third \\\"%c\\\" not found - log_line_prefix may be wrong\\n\", lineno, SEPCHAR);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\t*(part4++) = '\\0';\n\t}\n\n\tif (NULL == (part5 = strchr(part4, SEPCHAR))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: fourth \\\"%c\\\" not found - log_line_prefix may be wrong\\n\", lineno, SEPCHAR);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\t*(part5++) = '\\0';\n\t}\n\n\tif (NULL == (part6 = strstr(part5, \":  \"))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: log message does not begin with a log type\\n\", lineno);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\t*part6 = '\\0';\n\t\tpart6 += 3;\n\t}\n\n\t/* first part is the time, parse it into parameter */\n\tif ((errmsg = parse_time(line, time))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: %s\\n\", lineno, errmsg);\n\t\tfree(line);\n\t\treturn -1;\n\t}\n\n\t/* second part is the username, copy to parameter */\n\tif (NAMELEN < strlen(part2)) {\n\t\tfprintf(stderr, \"Error parsing line %lu: username exceeds %d characters\\n\", lineno, NAMELEN);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\tstrcpy(user, part2);\n\t}\n\n\t/* third part is the database, copy to parameter */\n\tif (NAMELEN < strlen(part3)) {\n\t\tfprintf(stderr, \"Error parsing line %lu: database name exceeds %d characters\\n\", lineno, NAMELEN);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\tstrcpy(database, part3);\n\t}\n\n\t/* fourth part is the session ID, copy to parameter */\n\tif ((errmsg = parse_session(part4, session_id))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: %s\\n\", lineno, errmsg);\n\t\tfree(line);\n\t\treturn -1;\n\t}\n\n\t/* fifth part is the log type, copy to parameter */\n\t*type = to_log_type(part5);\n\n\t/* sixth part is the log message */\n\toverlap_strcpy(line, part6);\n\t*message = line;\n\n\t/* read the next log entry so that we can peek at it */\n\tline = NULL;\n\tdo {\n\t\tif (NULL != line) {\n\t\t\tfree(line);\n\t\t}\n\t\tif (NULL == (line = read_log_line())) {\n\t\t\tfree(*message);\n\t\t\t*message = NULL;\n\t\t\treturn -1;\n\t\t}\n\n\t\t/* is it the start of a memory dump? */\n\t\tif (0 == strncmp(line, \"TopMemoryContext: \", 18)) {\n\t\t\tfprintf(stderr, \"Found memory dump in line %lu\\n\", lineno);\n\t\t\tdump_found = 1;\n\t\t\tskip_line = 1;\n\t\t} else {\n\t\t\t/* if there is a dump and the line starts blank,\n\t\t\t   assume the line is part of the dump\n\t\t\t*/\n\t\t\tif (dump_found && (' ' == *line)) {\n\t\t\t\tskip_line = 1;\n\t\t\t} else {\n\t\t\t\tskip_line = 0;\n\t\t\t}\n\t\t}\n\t} while (('\\0' != *line) && skip_line);\n\n\tif ('\\0' == *line) {\n\t\t/* EOF, that's ok */\n\t\tkeepline = line;\n\t} else {\n\t\t/* skip four | to the fifth part */\n\t\tpart2 = line;\n\t\tfor (i=0; i<4; ++i) {\n\t\t\tif (NULL == (part2 = strchr(part2, SEPCHAR))) {\n\t\t\t\tfprintf(stderr, \"Error parsing line %lu: only %d \\\"%c\\\" found - log_line_prefix may be wrong\\n\", lineno, i, SEPCHAR);\n\t\t\t\tfree(*message);\n\t\t\t\tfree(line);\n\t\t\t\t*message = NULL;\n\t\t\t\treturn -1;\n\t\t\t} else {\n\t\t\t\t++part2;\n\t\t\t}\n\t\t}\n\n\t\t/* check if it is a DETAIL */\n\t\tif (strncmp(part2, \"DETAIL:  \", 9)) {\n\t\t\t/* if not, remember the line for the next pass */\n\t\t\tkeepline = line;\n\t\t} else {\n\t\t\tdebug(2, \"Found a DETAIL message%s\\n\", \"\");\n\n\t\t\t/* set the return parameter to the detail message */\n\t\t\toverlap_strcpy(line, part2 + 9);\n\t\t\t*detail = line;\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving parse_errlog_entry%s\\n\", \"\");\n\treturn 1;\n}\n\n/* parses the next CSV log entry\n   timestamp, user, database, session ID, log message type, log message\n   and detail message are returned in the respective parameters\n   \"message\" is malloc'ed, \"detail\" not\n   return values: -1 (error), 0 (end-of-file), or 1 (success) */\n\nstatic int parse_csvlog_entry(struct timeval *time, char *user, char *database, uint64_t *session_id, log_type *type, char **message, char **detail) {\n\tchar *line = NULL, *part[16], *p1, *p2;\n\tconst char *errmsg;\n\tint i, escaped = 0;\n\n\tdebug(3, \"Entering parse_csvlog_entry%s\\n\", \"\");\n\n\t/* initialize message and detail with NULL */\n\t*message = NULL;\n\t*detail = NULL;\n\n\t/* read next line after start timestamp from log file */\n\tdo {\n\t\tif (line) {\n\t\t\tfree(line);\n\t\t}\n\t\tif (NULL == (line = read_log_line())) {\n\t\t\treturn -1;\n\t\t}\n\t} while (('\\0' != *line)\n\t\t&& (start_time && (strncmp(line, start_time, 23) < 0)));\n\n\t/* check for EOF */\n\tif (('\\0' == *line) || (end_time && (strncmp(line, end_time, 23) > 0))) {\n\t\tfree(line);\n\t\tdebug(3, \"Leaving parse_errlog_entry%s\\n\", \"\");\n\t\treturn 0;\n\t}\n\n\t/* parse first 15 parts from the CSV record */\n\tpart[0] = p1 = line;\n\tfor (i=1; i<16; ++i) {\n\t\tp2 = p1;\n\t\t/* copy p1 to p2 until we hit an unescaped comma,\n\t\t   remove escaping double quotes */\n\t\twhile (escaped || (',' != *p1)) {\n\t\t\tswitch (*p1) {\n\t\t\t\tcase '\\0':\n\t\t\t\t\tfprintf(stderr, \"Error parsing line %lu: comma number %d not found (or unmatched quotes)\\n\", lineno, i);\n\t\t\t\t\tfree(line);\n\t\t\t\t\treturn -1;\n\t\t\t\tcase '\"':\n\t\t\t\t\t/* don't copy the first double quote */\n\t\t\t\t\tif (!escaped && (p1 != part[i-1])) {\n\t\t\t\t\t\t*(p2++) = '\"';\n\t\t\t\t\t}\n\t\t\t\t\t++p1;\n\t\t\t\t\tescaped = !escaped;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t*(p2++) = *(p1++);\n\t\t\t}\n\t\t}\n\t\t*p2 = '\\0';\n\t\tpart[i] = ++p1;\n\t}\n\n\t/* first part is the time, parse it into parameter */\n\tif ((errmsg = parse_time(part[0], time))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: %s\\n\", lineno, errmsg);\n\t\tfree(line);\n\t\treturn -1;\n\t}\n\n\t/* second part is the username, copy to parameter */\n\tif (NAMELEN < strlen(part[1])) {\n\t\tfprintf(stderr, \"Error parsing line %lu: username exceeds %d characters\\n\", lineno, NAMELEN);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\tstrcpy(user, part[1]);\n\t}\n\n\t/* third part is the database, copy to parameter */\n\tif (NAMELEN < strlen(part[2])) {\n\t\tfprintf(stderr, \"Error parsing line %lu: database name exceeds %d characters\\n\", lineno, NAMELEN);\n\t\tfree(line);\n\t\treturn -1;\n\t} else {\n\t\tstrcpy(database, part[2]);\n\t}\n\n\t/* sixth part is the session ID, copy to parameter */\n\tif ((errmsg = parse_session(part[5], session_id))) {\n\t\tfprintf(stderr, \"Error parsing line %lu: %s\\n\", lineno, errmsg);\n\t\tfree(line);\n\t\treturn -1;\n\t}\n\n\t/* twelfth part is the log type, copy to parameter */\n\t*type = to_log_type(part[11]);\n\n\t/* fourteenth part is the message, assign to output parameter */\n\toverlap_strcpy(line, part[13]);\n\t*message = line;\n\n\t/* detail is the fifteenth part of the line, if not empty */\n\t*detail = part[14];\n\tif ('\\0' == **detail) {\n\t\t*detail = NULL;\n\t}\n\n\tdebug(3, \"Leaving parse_csvlog_entry%s\\n\", \"\");\n\treturn 1;\n}\n\n/* add (malloc) the prepared statement name to the list of\n   prepared statements for the connection\n   returns 0 if the statement already existed, 1 if it was added and -1 if there was an error */\n\nstatic int add_pstmt(struct connection * conn, char const *name) {\n\tstruct prep_stmt *pstmt = conn->statements;\n\tint rc;\n\n\tdebug(3, \"Entering add_pstmt for statement \\\"%s\\\"\\n\", name);\n\n\tif ('\\0' == *name) {\n\t\t/* the empty statement will never be stored, but should be prepared */\n\t\trc = 1;\n\n\t\t/* count for statistics */\n\t\t++stat_param;\n\t} else {\n\t\twhile (pstmt && strcmp(pstmt->name, name)) {\n\t\t\tpstmt = pstmt->next;\n\t\t}\n\n\t\tif (pstmt) {\n\t\t\t/* statement already prepared */\n\t\t\tdebug(2, \"Prepared statement is already in list%s\\n\", \"\");\n\t\t\trc = 0;\n\t\t} else {\n\t\t\tdebug(2, \"Adding prepared statement to list%s\\n\", \"\");\n\t\t\t/* add statement name to linked list */\n\t\t\tif (NULL == (pstmt = malloc(sizeof(struct prep_stmt)))) {\n\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)sizeof(struct prep_stmt));\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (NULL == (pstmt->name = malloc(strlen(name) + 1))) {\n\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(name) + 1);\n\t\t\t\tfree(pstmt);\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tstrcpy(pstmt->name, name);\n\t\t\tpstmt->next = conn->statements;\n\t\t\tconn->statements = pstmt;\n\t\t\trc = 1;\n\n\t\t\t/* count for statistics */\n\t\t\t++stat_named;\n\t\t}\n\t\t/* count for statistics */\n\t\t++stat_execnamed;\n\t}\n\n\tdebug(3, \"Leaving add_pstmt%s\\n\", \"\");\n\treturn rc;\n}\n\n/* remove (free) the prepared statement name to the list of\n   prepared statements for the connection */\n\nstatic void remove_pstmt(struct connection * conn, char const *name) {\n\tstruct prep_stmt *pstmt = conn->statements, *pstmt2 = NULL;\n\n\tdebug(3, \"Entering remove_pstmt for statement \\\"%s\\\"\\n\", name);\n\n\twhile (pstmt && strcmp(pstmt->name, name)) {\n\t\tpstmt2 = pstmt;  /*remember previous */\n\t\tpstmt = pstmt->next;\n\t}\n\n\tif (pstmt) {\n\t\tif (pstmt2) {\n\t\t\tpstmt2->next = pstmt->next;\n\t\t} else {\n\t\t\tconn->statements = pstmt->next;\n\t\t}\n\t\tfree(pstmt->name);\n\t\tfree(pstmt);\n\t} else {\n\t\tdebug(2, \"Prepared statement not found%s\\n\", \"\");\n\t}\n\n\tdebug(3, \"Leaving remove_pstmt%s\\n\", \"\");\n\treturn;\n}\n\nstatic void remove_all_pstmts(struct connection * conn) {\n\tstruct prep_stmt *pstmt = conn->statements, *pstmt2 = NULL;\n\n\tdebug(3, \"Entering remove_all_pstmts%s\\n\", \"\");\n\n\twhile(pstmt) {\n\t\tpstmt2 = pstmt;\n\t\tpstmt = pstmt->next;\n\t\tfree(pstmt2->name);\n\t\tfree(pstmt2);\n\t}\n\tconn->statements = NULL;\n\n\tdebug(3, \"Leaving remove_all_pstmts%s\\n\", \"\");\n\treturn;\n}\n\n/* remove all \"COPY\" and \"SET client_encoding\" statements;\n   for DEALLOCATE statements, try to remove prepared statement */\n\n/* maximum number of tokens we need to analyze a statement */\n#define MAX_TOKENS 3\n\nstatic int filter_bad_statements(char *line, struct connection *conn) {\n\tchar *statement = line, *p = line, token[MAX_TOKENS][NAMELEN + 1],\n\t\t*q = NULL, *quote, *h;\n\tint comment_depth, tokens = 0, ok = 1, i, nameindex, quotelen;\n\n\tdebug(3, \"Entering filter_bad_statements%s\\n\", \"\");\n\n\tfor (i=0; i<MAX_TOKENS; ++i) {\n\t\ttoken[i][0] = '\\0';\n\t}\n\n\twhile (ok) {\n\t\tif (('\\0' == *p) || (';' == *p)) {\n\t\t\t/* end of a statement found */\n\t\t\tif (tokens > 0) {\n\t\t\t\t/* count parsed simple statements */\n\t\t\t\t++stat_simple;\n\n\t\t\t\t/* remove statements that won't work */\n\n\t\t\t\tif (! strcmp(\"copy\", token[0])) {\n\t\t\t\t\tfprintf(stderr, \"Warning: COPY statement ignored in line %lu\\n\", lineno);\n\t\t\t\t\t/* replace statement with blanks */\n\t\t\t\t\twhile (statement < p) {\n\t\t\t\t\t\t*(statement++) = ' ';\n\t\t\t\t\t}\n\n\t\t\t\t\t/* count for statistics */\n\t\t\t\t\t++stat_copy;\n\t\t\t\t} else if ((tokens > 1) && (! strcmp(\"set\", token[0])) && (! strcmp(\"client_encoding\", token[1]))) {\n\t\t\t\t\tfprintf(stderr, \"Warning: \\\"SET client_encoding\\\" statement ignored in line %lu\\n\", lineno);\n\t\t\t\t\t/* replace statement with blanks */\n\t\t\t\t\twhile (statement < p) {\n\t\t\t\t\t\t*(statement++) = ' ';\n\t\t\t\t\t}\n\t\t\t\t} else if (! strcmp(\"deallocate\", token[0])) {\n\t\t\t\t\t/* there coule be a \"prepare\" in the second token, should be ignored */\n\t\t\t\t\tif (strcmp(\"prepare\", token[1])) {\n\t\t\t\t\t\tnameindex = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnameindex = 2;\n\t\t\t\t\t}\n\t\t\t\t\tif (strcmp(\"all\", token[nameindex])) {\n\t\t\t\t\t\t/* deallocate single statement */\n\t\t\t\t\t\tdebug(2, \"Deallocating prepared statement \\\"%s\\\"\\n\", token[nameindex]);\n\t\t\t\t\t\tremove_pstmt(conn, token[nameindex]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* deallocate all prepared statements */\n\t\t\t\t\t\tdebug(2, \"Deallocating all prepared statements%s\\n\", \"\");\n\t\t\t\t\t\tremove_all_pstmts(conn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* break out of loop if end-of-line is reached */\n\t\t\tif ('\\0' == *p) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t/* else prepare for next statement */\n\t\t\tstatement = ++p;\n\t\t\tfor (i=0; i<MAX_TOKENS; ++i) {\n\t\t\t\ttoken[i][0] = '\\0';\n\t\t\t}\n\t\t\ttokens = 0;\n\t\t} else if ((('E' == *p) || ('e' == *p)) && ('\\'' == p[1])) {\n\t\t\t/* special string constant; skip to end */\n\t\t\t++p;\n\t\t\twhile ('\\0' != *(++p)) {\n\t\t\t\tif ('\\'' == *p) {\n\t\t\t\t\tif ('\\'' == p[1]) {\n\t\t\t\t\t\t/* regular escaped apostrophe */\n\t\t\t\t\t\t++p;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (('\\\\' == *p) && (('\\'' == p[1]) || ('\\\\' == p[1]))) {\n\t\t\t\t\t/* backslash escaped apostrophe or backslash */\n\t\t\t\t\t++p;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ('\\0' == *p) {\n\t\t\t\tfprintf(stderr, \"Error: string literal not closed near line %lu\\n\"\n\t\t\t\t\t\"Hint: retry with%s the -q option\\n\",\n\t\t\t\t\tlineno, (backslash_quote ? \"out\" : \"\"));\n\t\t\t\tok = 0;\n\t\t\t} else {\n\t\t\t\t++p;\n\t\t\t}\n\t\t} else if ('\\'' == *p) {\n\t\t\t/* simple string constant; skip to end */\n\t\t\twhile ('\\0' != *(++p)) {\n\t\t\t\tif ('\\'' == *p) {\n\t\t\t\t\tif ('\\'' == p[1]) {\n\t\t\t\t\t\t/* regular escaped apostrophe */\n\t\t\t\t\t\t++p;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (backslash_quote && ('\\\\' == *p) && (('\\'' == p[1]) || ('\\\\' == p[1]))) {\n\t\t\t\t\t/* backslash escaped apostrophe or backslash */\n\t\t\t\t\t++p;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ('\\0' == *p) {\n\t\t\t\tfprintf(stderr, \"Error: string literal not closed near line %lu\\n\"\n\t\t\t\t\t\"Hint: retry with%s the -q option\\n\",\n\t\t\t\t\tlineno, (backslash_quote ? \"out\" : \"\"));\n\t\t\t\tok = 0;\n\t\t\t} else {\n\t\t\t\t++p;\n\t\t\t}\n\t\t} else if (('$' == *p) && (('0' > *(p+1)) || (('9' < *(p+1))))) {\n\t\t\t/* dollar quoted string constant; skip to end */\n\t\t\tquote = p++;\n\t\t\twhile (('$' != *p) && ('\\0' != *p)) {\n\t\t\t\t++p;\n\t\t\t}\n\t\t\tif ('\\0' == *p) {\n\t\t\t\tfprintf(stderr, \"Error: end of dollar quote not found in line %lu\\n\", lineno);\n\t\t\t\tok = 0;\n\t\t\t} else {\n\t\t\t\tquotelen = p - quote;\n\t\t\t\t*p = '\\0';\n\t\t\t\th = p;\n\t\t\t\tdo {\n\t\t\t\t\th = strstr(++h, quote);\n\t\t\t\t} while ((NULL != h) && ('$' != *(h + quotelen)));\n\t\t\t\t*p = '$';\n\t\t\t\tif (NULL == h) {\n\t\t\t\t\tfprintf(stderr, \"Error: end of dollar quoted string found in line %lu\\n\", lineno);\n\t\t\t\t\tok = 0;\n\t\t\t\t} else {\n\t\t\t\t\tp = h + (quotelen + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (('-' == *p) && ('-' == p[1])) {\n\t\t\t/* comment; skip to end of line or statement */\n\t\t\twhile (('\\n' != *p) && ('\\0' != *p)) {\n\t\t\t\t++p;\n\t\t\t}\n\t\t} else if (('/' == *p) && ('*' == p[1])) {\n\t\t\t/* comment, skip to matching end */\n\t\t\tp += 2;\n\t\t\tcomment_depth = 1;  /* comments can be nested */\n\t\t\twhile (0 != comment_depth) {\n\t\t\t\tif ('\\0' == *p) {\n\t\t\t\t\tfprintf(stderr, \"Error: comment not closed in line %lu\\n\", lineno);\n\t\t\t\t\tok = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (('*' == *p) && ('/' == p[1])) {\n\t\t\t\t\t--comment_depth;\n\t\t\t\t\tp += 2;\n\t\t\t\t} else if (('/' == *p) && ('*' == p[1])) {\n\t\t\t\t\t++comment_depth;\n\t\t\t\t\tp += 2;\n\t\t\t\t} else {\n\t\t\t\t\t++p;\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ('\"' == *p) {\n\t\t\t/* quoted identifier, copy to token if necessary */\n\t\t\tif (tokens < MAX_TOKENS) {\n\t\t\t\tq = token[tokens];\n\t\t\t}\n\t\t\twhile (1) {\n\t\t\t\t++p;\n\t\t\t\tif ('\\0' == *p) {\n\t\t\t\t\tfprintf(stderr, \"Error: quoted identifier not closed in line %lu\\n\", lineno);\n\t\t\t\t\tok = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t} else if ('\"' == *p) {\n\t\t\t\t\tif ('\"' == p[1]) {\n\t\t\t\t\t\t/* double \" means a single \" in a quoted identifier */\n\t\t\t\t\t\tif ((tokens < MAX_TOKENS) && (q - token[tokens] < NAMELEN)) {\n\t\t\t\t\t\t\t*(q++) = '\"';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++p;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* end of token */\n\t\t\t\t\t\tif (tokens < MAX_TOKENS) {\n\t\t\t\t\t\t\t*q = '\\0';\n\t\t\t\t\t\t\t++tokens;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++p;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* normal character, copy to token */\n\t\t\t\t\tif ((tokens < MAX_TOKENS) && (q - token[tokens] < NAMELEN)) {\n\t\t\t\t\t\t*(q++) = *p;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ((('A' <= *p) && ('Z' >= *p))\n\t\t\t\t|| (('a' <= *p) && ('z' >= *p))\n\t\t\t\t|| (127 < (unsigned char)(*p))  /* consider > 127 as letter */\n\t\t\t\t|| ('_' == *p)) {\n\t\t\t/* normal identifier, copy to token if necessary */\n\t\t\tif (tokens < MAX_TOKENS) {\n\t\t\t\tq = token[tokens];\n\t\t\t}\n\t\t\twhile ((('A' <= *p) && ('Z' >= *p))\n\t\t\t\t\t|| (('a' <= *p) && ('z' >= *p))\n\t\t\t\t\t|| (('0' <= *p) && ('9' >= *p))\n\t\t\t\t\t|| (127 < (unsigned char)(*p))  /* consider > 127 as letter */\n\t\t\t\t\t|| ('_' == *p) || ('$' == *p)) {\n\t\t\t\tif ((tokens < MAX_TOKENS) && (q - token[tokens] < NAMELEN)) {\n\t\t\t\t\t/* convert to lowercase */\n\t\t\t\t\t*(q++) = *p + ('a' - 'A') * ((*p >= 'A') && (*p <= 'Z'));\n\t\t\t\t}\n\t\t\t\t++p;\n\t\t\t}\n\t\t\t*q = '\\0';\n\t\t\t++tokens;\n\t\t} else {\n\t\t\t/* everything else is considered unimportant */\n\t\t\t++p;\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving filter_bad_statements%s\\n\", \"\");\n\treturn ok;\n}\n\n/* check if there is a connection for this session_id\n   if not, a new connection replay_item is generated and returned in r\n   return values: found or created hash entry for success, NULL for failure */\n\nstatic struct connection *add_connection(replay_item **r, struct timeval *time, const char *user, const char *database, uint64_t session_id) {\n\tunsigned char hash = hash_session(session_id);\n\tstruct connection *conn = open_conn[hash];\n\n\tdebug(3, \"Entering add_connection for session 0x\" UINT64_FORMAT \"\\n\", session_id);\n\n\twhile (conn && (conn->session_id != session_id)) {\n\t\tconn = conn->next;\n\t}\n\n\tif (conn) {\n\t\t/* session already exists */\n\t\t*r = NULL;\n\t} else {\n\t\t/* session doesn't exist yet; create it and add it to hash table */\n\t\tif (NULL == (*r = replay_create_connect(time, session_id, user, database))) {\n\t\t\t/* something went wrong */\n\t\t\treturn NULL;\n\t\t} else {\n\t\t\tif ((conn = malloc(sizeof(struct connection)))) {\n\t\t\t\tconn->next = open_conn[hash];\n\t\t\t\tconn->statements = NULL;\n\t\t\t\tconn->session_id = session_id;\n\t\t\t\topen_conn[hash] = conn;\n\t\t\t} else {\n\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)sizeof(struct connection));\n\t\t\t\treplay_free(*r);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving add_connection%s\\n\", \"\");\n\treturn conn;\n}\n\n/* remove a connection from the hash structure\n   returns 1 for success, 0 for failure        */\n\nstatic int remove_connection(uint64_t session_id) {\n\tunsigned char hash = hash_session(session_id);\n\tstruct connection *conn = open_conn[hash], *conn2 = NULL;\n\n\tdebug(3, \"Entering remove_connection for session 0x\" UINT64_FORMAT \"\\n\", session_id);\n\n\twhile (conn && (conn->session_id != session_id)) {\n\t\tconn2 = conn; /* remember previous */\n\t\tconn = conn->next;\n\t}\n\n\tif (conn) {\n\t\tremove_all_pstmts(conn);\n\t\tif (conn2) {\n\t\t\tconn2->next = conn->next;\n\t\t} else {\n\t\t\topen_conn[hash] = conn->next;\n\t\t}\n\t\tfree(conn);\n\t}\n\n\tdebug(3, \"Leaving remove_connection%s\\n\", \"\");\n\n\treturn (NULL != conn);\n}\n\n/* tokenizes the \"line\" into single arguments, pointers to which\n   are stored in \"result\" (which is malloc'ed and must be freed)\n   returns the number of arguments and -1 if there is an error\n   Note that the strings that \"result\" points to are *not* malloc'ed,\n   but part of \"line\" */\n\nstatic int parse_bind_args(char *** const result, char *line) {\n\tint count = 0;\n\tchar *p, *p1;\n\n\t*result = NULL;\n\n\tdebug(3, \"Entering parse_bind_args%s\\n\", \"\");\n\n\t/* count the dollar signs in the line = upper limit for number of arguments */\n\tfor (p=line; '\\0'!=*p; ++p) {\n\t\tif ('$' == *p) {\n\t\t\t++count;\n\t\t}\n\t}\n\t/* if there is none, we are done */\n\tif (! count) {\n\t\treturn 0;\n\t}\n\n\t/* allocate result */\n\tif (NULL == (*result = calloc(count, sizeof(char **)))) {\n\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)sizeof(char **));\n\t\treturn -1;\n\t}\n\n\t/* reset count - now we will really count */\n\tcount = 0;\n\n\t/* loop until end of the line */\n\tp = line;\n\twhile ('\\0' != *p) {\n\t\t/* expect \"$<number> = \" */\n\t\tif ('$' != *(p++)) {\n\t\t\tfprintf(stderr, \"Error: no dollar sign found in argument %d in line %lu\\n\", count, lineno);\n\t\t\tfree(*result);\n\t\t\t*result = NULL;\n\t\t\treturn -1;\n\t\t}\n\t\twhile (('0' <= *p) && ('9' >= *p)) {\n\t\t\t++p;\n\t\t}\n\t\tif ((' ' != p[0]) || ('=' != p[1]) || (' ' != p[2])) {\n\t\t\tfprintf(stderr, \"Error: bad format in argument %d in line %lu\\n\", count, lineno);\n\t\t\tfree(*result);\n\t\t\t*result = NULL;\n\t\t\treturn -1;\n\t\t}\n\t\tp += 3;\n\n\t\tif ('\\'' == *p) {\n\t\t\t/* normal argument in single quotes */\n\t\t\t(*result)[count] = p1 = ++p;\n\n\t\t\t/* eliminate double single quotes and search for ending single quote */\n\t\t\twhile (*p1) {\n\t\t\t\tif ('\\0' == *p) {\n\t\t\t\t\tfprintf(stderr, \"Error: unexpected end of line in argument %d in line %lu\\n\", count, lineno);\n\t\t\t\t\tfree(*result);\n\t\t\t\t\t*result = NULL;\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\tif ('\\'' == *p) {\n\t\t\t\t\t/* single quote encountered */\n\t\t\t\t\tif ('\\'' == p[1]) {\n\t\t\t\t\t\t/* double single quote, skip one */\n\t\t\t\t\t\t*(p1++) = '\\'';\n\t\t\t\t\t\t++p;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* end of argument */\n\t\t\t\t\t\t*p1 = '\\0';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* normal character */\n\t\t\t\t\t*(p1++) = *p;\n\t\t\t\t}\n\t\t\t\t++p;\n\t\t\t}\n\t\t} else {\n\t\t\t/* must me NULL argument */\n\t\t\tif (('N' == p[0]) && ('U' == p[1]) && ('L' == p[2]) && ('L' == p[3])) {\n\t\t\t\t(*result)[count] = NULL;\n\t\t\t\tp += 4;\n\t\t\t} else {\n\t\t\t\tfprintf(stderr, \"Error: expected NULL in argument %d in line %lu\\n\", count, lineno);\n\t\t\t\tfree(*result);\n\t\t\t\t*result = NULL;\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\t/* skip \", \" if present */\n\t\tif ((',' == p[0]) && (' ' == p[1])) {\n\t\t\tp += 2;\n\t\t}\n\n\t\t++count;\n\t}\n\n\tdebug(2, \"Parsed %d arguments\\n\", count);\n\tdebug(3, \"Leaving parse_bind_args%s\\n\", \"\");\n\n\treturn count;\n}\n\nstatic void print_parse_statistics() {\n\tint hours, minutes;\n\tdouble seconds;\n\tstruct timeval delta;\n\n\tfprintf(sf, \"\\nParse statistics\\n\");\n\tfprintf(sf, \"================\\n\\n\");\n\tfprintf(sf, \"Log lines read: %lu\\n\", lineno);\n\tfprintf(sf, \"Total SQL statements processed: %lu\\n\", stat_simple + stat_param + stat_execnamed);\n\tfprintf(sf, \"Simple SQL statements processed: %lu\\n\", stat_simple);\n\tif (stat_copy) {\n\t\tfprintf(sf, \"(includes %lu ignored copy statements)\\n\", stat_copy);\n\t}\n\tfprintf(sf, \"Parametrized SQL statements processed: %lu\\n\", stat_param);\n\tfprintf(sf, \"Named prepared SQL statements executions processed: %lu\\n\", stat_execnamed);\n\tif (stat_named) {\n\t\tfprintf(sf, \"Different named prepared SQL statements processed: %lu\\n\", stat_named);\n\t\tfprintf(sf, \"(average reuse count %.3f)\\n\", (double)(stat_execnamed - stat_named) / stat_named);\n\t}\n\tfprintf(sf, \"Cancel requests processed: %lu\\n\", stat_cancel);\n\tfprintf(sf, \"Fast-path function calls ignored: %lu\\n\", stat_fastpath);\n\n\t/* calculate lengh of the recorded workload */\n\ttimersub(&last_stmt_time, &first_stmt_time, &delta);\n\thours = delta.tv_sec / 3600;\n\tdelta.tv_sec -= hours * 3600;\n\tminutes = delta.tv_sec / 60;\n\tdelta.tv_sec -= minutes * 60;\n\tseconds = delta.tv_usec / 1000000.0 + delta.tv_sec;\n\n\tfprintf(sf, \"Duration of recorded workload:\");\n\tif (hours > 0) {\n\t\tfprintf(sf, \" %d hours\", hours);\n\t}\n\tif (minutes > 0) {\n\t\tfprintf(sf, \" %d minutes\", minutes);\n\t}\n\tfprintf(sf, \" %.3f seconds\\n\", seconds);\n}\n\nint parse_provider_init(const char *in, int parse_csv, const char *begin, const char *end, const char *db_only, const char *usr_only) {\n\tstatic struct tm tm;  /* initialize with zeros */\n\tint rc = 1;\n\n\tdebug(3, \"Entering parse_provider_init%s\\n\", \"\");\n\n\tif (NULL == in) {\n\t\tinfile = 0;\n\t} else {\n\t\tif (-1 == (infile = open(in, O_RDONLY))) {\n\t\t\tperror(\"Error opening input file\");\n\t\t\trc = 0;\n\t\t}\n\t}\n\n\tcsv = parse_csv;\n\tstart_time = begin;\n\tend_time = end;\n\tdatabase_only = db_only;\n\tusername_only = usr_only;\n\n\t/* initialize epoch with 2000-01-01 00:00:00 */\n\ttm.tm_year  = 2000 - 1900;\n\ttm.tm_mon   = 1 - 1;\n\ttm.tm_mday  = 1;\n\ttm.tm_hour  = 0;\n\ttm.tm_min   = 0;\n\ttm.tm_sec   = 0;\n\ttm.tm_isdst = 0;  /* ignore daylight savings time */\n\tepoch = mktime(&tm);\n\n\tdebug(3, \"Leaving parse_provider_init%s\\n\", \"\");\n\n\treturn rc;\n}\n\nvoid parse_provider_finish() {\n\tdebug(3, \"Entering parse_provider_finish%s\\n\", \"\");\n\n\tif (0 != infile) {\n\t\tif (close(infile)) {\n\t\t\tperror(\"Error closing input file:\");\n\t\t}\n\t}\n\n\tif (sf) {\n\t\tprint_parse_statistics();\n\t}\n\n\tdebug(3, \"Leaving parse_provider_finish%s\\n\", \"\");\n}\n\n/* the replay_item is malloc'ed and must be freed with replay_free()\n   will return NULL if an error occurred */\n\nreplay_item * parse_provider() {\n\treplay_item *r = NULL;\n\tchar *message = NULL, *detail = NULL, *statement = NULL, *namep = NULL, name[NAMELEN + 1], **args, user[NAMELEN + 1], database[NAMELEN + 1], quote_name[NAMELEN + 3];\n\tlog_type logtype;\n\tuint64_t session_id;\n\tint count, i;\n\t/* possible stati: -1 = error, 0 = looking for log line, 1 = interesting line found\n\t                   2 = using cached value, 3 = EOF */\n\tint status = 0;\n\treplay_type type = -1;  /* -1 is an impossible value */\n\tstruct timeval time;\n\t/* remember time from last parsed line */\n\tstatic struct timeval oldtime = { 0, 0 };\n\tstruct connection *conn = NULL;\n\t/* queue of up to two replay items */\n\tstatic replay_item *queue[2] = { NULL, NULL };\n\tstatic int first_stmt_time_set = 0;\n\n\tdebug(3, \"Entering parse_provider%s\\n\", \"\");\n\n\tif (queue[0]) {\n\t\t/* if there is something in the queue, return it */\n\t\tdebug(2, \"Queue is not empty, returning top element%s\\n\", \"\");\n\t\tr = queue[0];\n\t\tqueue[0] = queue[1];\n\t\tqueue[1] = NULL;\n\n\t\tstatus = 2;\n\t}\n\n\t/* read a log entry until we find an interesting one */\n\twhile (0 == status) {\n\t\tswitch ((*parse_log_entry[csv])(&time, user, database, &session_id, &logtype, &message, &detail)) {\n\t\t\tcase 0:\n\t\t\t\t/* EOF encountered */\n\t\t\t\tstatus = 3;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t/* Do not process line that does not match any of the specified users and databases */\n\t\t\t\tmemset(quote_name, '\\0', NAMELEN + 3);\n\t\t\t\tif ('\\0' != *database) {\n\t\t\t\t\tquote_name[0] = '\\\\';\n\t\t\t\t\tstrcat(quote_name, database);\n\t\t\t\t\tstrcat(quote_name, \"\\\\\");\n\t\t\t\t}\n\t\t\t\tif ((NULL != database_only) && (NULL == strstr(database_only, quote_name))) {\n\t\t\t\t\tdebug(2, \"Database \\\"%s\\\" does not match filter, skipped log entry\\n\", database);\n\t\t\t\t\tfree(message);\n\t\t\t\t\tif (! csv && detail) {\n\t\t\t\t\t\tfree(detail);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmemset(quote_name, '\\0', NAMELEN + 3);\n\t\t\t\tif ('\\0' != *user) {\n\t\t\t\t\tquote_name[0] = '\\\\';\n\t\t\t\t\tstrcat(quote_name, user);\n\t\t\t\t\tstrcat(quote_name, \"\\\\\");\n\t\t\t\t}\n\t\t\t\tif ((NULL != username_only) && (NULL == strstr(username_only, quote_name))) {\n\t\t\t\t\tdebug(2, \"User \\\"%s\\\" does not match filter, skipped log entry\\n\", user);\n\t\t\t\t\tfree(message);\n\t\t\t\t\tif (! csv && detail) {\n\t\t\t\t\t\tfree(detail);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t/* check line prefix to determine type */\n\t\t\t\tif ((log_log == logtype) && (! strncmp(message, \"connection authorized: \", 23))) {\n\t\t\t\t\tdebug(2, \"Connection 0x\" UINT64_FORMAT \" found\\n\", session_id);\n\t\t\t\t\ttype = pg_connect;\n\t\t\t\t\tstatement = message + 23;\n\t\t\t\t\tstatus = 1;\n\t\t\t\t} else if ((log_log == logtype) && (! strncmp(message, \"disconnection: \", 15))) {\n\t\t\t\t\tdebug(2, \"Disconnection found%s\\n\", \"\");\n\t\t\t\t\ttype = pg_disconnect;\n\t\t\t\t\tstatement = message + 15;\n\t\t\t\t\tstatus = 1;\n\t\t\t\t} else if ((log_log == logtype) && (! strncmp(message, \"statement: \", 11))) {\n\t\t\t\t\tdebug(2, \"Simple statement found%s\\n\", \"\");\n\t\t\t\t\ttype = pg_execute;\n\t\t\t\t\tstatement = message + 11;\n\t\t\t\t\tstatus = 1;\n\t\t\t\t} else if ((log_log == logtype) && (! strncmp(message, \"execute \", 8))) {\n\t\t\t\t\tdebug(2, \"Prepared statement execution found%s\\n\", \"\");\n\t\t\t\t\ttype = pg_exec_prepared;\n\t\t\t\t\tnamep = message + 8;\n\t\t\t\t\tif ((statement = strchr(namep, ':'))) {\n\t\t\t\t\t\t/* split in name and statement */\n\t\t\t\t\t\t*(statement++) = '\\0';\n\t\t\t\t\t\t++statement;\n\t\t\t\t\t\t/* check for unnamed statement, change name to empty string */\n\t\t\t\t\t\tif (! strcmp(namep, \"<unnamed>\")) {\n\t\t\t\t\t\t\t*namep = '\\0';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstatus = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfprintf(stderr, \"Error: missing statement name in line %lu\\n\", lineno);\n\t\t\t\t\t\tstatus = -1;\n\t\t\t\t\t}\n\t\t\t\t} else if ((log_error == logtype) && (! strncmp(message, \"canceling statement due to user request\", 39))) {\n\t\t\t\t\tdebug(2, \"Cancel request found%s\\n\", \"\");\n\t\t\t\t\ttype = pg_cancel;\n\t\t\t\t\tstatus = 1;\n\t\t\t\t} else if ((log_log == logtype) && (! strncmp(message, \"fastpath function call: \", 24))) {\n\t\t\t\t\tfree(message);\n\t\t\t\t\tif (! csv && detail) {\n\t\t\t\t\t\tfree(detail);\n\t\t\t\t\t}\n\t\t\t\t\tfprintf(stderr, \"Warning: fast-path function call ignored in line %lu\\n\", lineno);\n\n\t\t\t\t\t/* count for statistics */\n\t\t\t\t\t++stat_fastpath;\n\t\t\t\t} else {\n\t\t\t\t\tfree(message);\n\t\t\t\t\tif (! csv && detail) {\n\t\t\t\t\t\tfree(detail);\n\t\t\t\t\t}\n\t\t\t\t\tdebug(2, \"Skipped log entry%s\\n\", \"\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/* something went wrong */\n\t\t\t\tstatus = -1;\n\t\t}\n\t}\n\n\t/* if everything is ok so far, search for a connection in our list\n       add one if there is none so far, store the \"connect\" replay_item in r */\n\tif (1 == status) {\n\t\t/* we need a connection in any case */\n\t\tif ((conn = add_connection(&r, &time, user, database, session_id))) {\n\t\t\tif (r && (pg_connect != type)) {\n\t\t\t\tdebug(2, \"Automatically generated connection%s\\n\", \"\");\n\t\t\t}\n\t\t\tif ((!r) && (pg_connect == type)) {\n\t\t\t\t/* if the connection already existed and we read\n\t\t\t\t   a connect line, that is an error */\n\t\t\t\tfprintf(stderr, \"Error: duplicate session ID 0x\" UINT64_FORMAT \"\\n\", session_id);\n\t\t\t\tstatus = -1;\n\t\t\t}\n\t\t} else {\n\t\t\t/* error occurred */\n\t\t\tstatus = -1;\n\t\t}\n\t}\n\n\t/* if everything is ok so far, process line according to type\n\t   result will be stored in queue[0] and queue[1] */\n\tif (1 == status) {\n\t\tswitch (type) {\n\t\t\tcase pg_connect:\n\t\t\t\t/* we are status! */\n\t\t\t\tbreak;\n\t\t\tcase pg_disconnect:\n\t\t\t\tif (NULL == (queue[0] = replay_create_disconnect(&time, session_id))) {\n\t\t\t\t\tstatus = -1;\n\t\t\t\t}\n\t\t\t\t/* remove connection from hash structure */\n\t\t\t\tif (! remove_connection(session_id)) {\n\t\t\t\t\t/* can't happen */\n\t\t\t\t\tfprintf(stderr, \"Error: cannot remove connection \" UINT64_FORMAT \" from hash table\\n\", session_id);\n\t\t\t\t\tstatus = -1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_execute:\n\t\t\t\tif (filter_bad_statements(statement, conn)) {\n\t\t\t\t\tif (NULL == (queue[0] = replay_create_execute(&time, session_id, statement))) {\n\t\t\t\t\t\tstatus = -1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstatus = -1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_exec_prepared:\n\t\t\t\t/* we don't need to filter, since it can only be a single statement\n\t\t\t\t   and neither COPY nor SET can be prepared statements */\n\n\t\t\t\t/* make a persistent copy of the statement name */\n\t\t\t\tstrcpy(name, namep);\n\n\t\t\t\t/* see if this is a new statement */\n\t\t\t\tswitch (add_pstmt(conn, name)) {\n\t\t\t\t\tcase 1:  /* new */\n\t\t\t\t\t\tif (NULL == (queue[0] = replay_create_prepare(&time, session_id, name, statement))) {\n\t\t\t\t\t\t\tstatus = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/* the detail message is read later */\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 0:  /* statement already exists */\n\t\t\t\t\t\t/* the detail message is read later */\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:  /* error */\n\t\t\t\t\t\tstatus = -1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_cancel:\n\t\t\t\tif (NULL == (queue[0] = replay_create_cancel(&time, session_id))) {\n\t\t\t\t\tstatus = -1;\n\t\t\t\t}\n\n\t\t\t\t/* count for statistics */\n\t\t\t\t++stat_cancel;\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t/* can't happen */\n\t\t\t\tfprintf(stderr, \"Error: impossible type parsing line %lu\\n\", lineno);\n\t\t\t\tstatus = -1;\n\t\t}\n\t}\n\n\t/* read and process the DETAIL message for a prepared statement */\n\tif ((1 == status) && (pg_exec_prepared == type)) {\n\n\t\tif (! detail) {\n\t\t\t/* no DETAIL message --> statement has no parameters */\n\t\t\tdebug(2, \"Prepared statement \\\"%s\\\" has no bind arguments\\n\", name);\n\t\t\tif (NULL == (queue[1] = replay_create_exec_prepared(&time, session_id, name, 0, NULL))) {\n\t\t\t\tstatus = -1;\n\t\t\t}\n\t\t} else if (strncmp(detail, \"parameters: \", 12)) {\n\t\t\tfprintf(stderr, \"Error: no parameters for prepared statement at line %lu\\n\", lineno);\n\t\t\tstatus = -1;\n\t\t} else {\n\t\t\tdebug(2, \"Reading bind arguments for prepared statement \\\"%s\\\"\\n\", name);\n\t\t\tstatement = detail + 12;\n\t\t\tif (-1 == (count = parse_bind_args(&args, statement))) {\n\t\t\t\tstatus = -1;\n\t\t\t} else {\n\t\t\t\tif (NULL == (queue[1] = replay_create_exec_prepared(&time, session_id, name, count, args))) {\n\t\t\t\t\tstatus = -1;\n\t\t\t\t}\n\t\t\t\tfree(args);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (! csv && detail) {\n\t\tfree(detail);\n\t}\n\tif (message) {\n\t\tfree(message);\n\t}\n\n\t/* if EOF, close all connections that are still open */\n\tif (3 == status) {\n\t\t/* search for entry in connection hash table */\n\t\tfor (i=0; i<256; ++i) {\n\t\t\tif (open_conn[i]) {\n\t\t\t\t/* entry found, create disconnect item */\n\t\t\t\tdebug(2, \"End-of-file encountered, creating disconnect item for session 0x\" UINT64_FORMAT \"\\n\", open_conn[i]->session_id);\n\t\t\t\tif (NULL == (r = replay_create_disconnect(&oldtime, open_conn[i]->session_id))) {\n\t\t\t\t\tstatus = -1;\n\t\t\t\t}\n\t\t\t\tremove_connection(open_conn[i]->session_id);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ((! r) && (3 == status)) {\n\t\t\tdebug(2, \"End-of-file encountered, signal end%s\\n\", \"\");\n\t\t\tr = end_item;\n\t\t}\n\t}\n\n\tif (1 == status) {\n\t\t/* condense queue */\n\t\tif (! queue[0]) {\n\t\t\tqueue[0] = queue[1];\n\t\t\tqueue[1] = NULL;\n\t\t}\n\t\tif (! r) {\n\t\t\tr = queue[0];\n\t\t\tqueue[0] = queue[1];\n\t\t\tqueue[1] = NULL;\n\t\t}\n\t\tif (! queue[0]) {\n\t\t\tqueue[0] = queue[1];\n\t\t\tqueue[1] = NULL;\n\t\t}\n\n\t\t/* remember time */\n\t\toldtime.tv_sec  = replay_get_time(r)->tv_sec;\n\t\toldtime.tv_usec = replay_get_time(r)->tv_usec;\n\n\t\tlast_stmt_time.tv_sec = replay_get_time(r)->tv_sec;\n\t\tlast_stmt_time.tv_usec = replay_get_time(r)->tv_usec;\n\t\tif (! first_stmt_time_set) {\n\t\t\tfirst_stmt_time.tv_sec = replay_get_time(r)->tv_sec;\n\t\t\tfirst_stmt_time.tv_usec = replay_get_time(r)->tv_usec;\n\n\t\t\tfirst_stmt_time_set = 1;\n\t\t}\n\t}\n\n\tif (-1 == status) {\n\t\t/* free items in queue */\n\t\tif (r) {\n\t\t\treplay_free(r);\n\t\t\tr = NULL;\n\t\t}\n\t\tif (queue[0]) {\n\t\t\treplay_free(queue[0]);\n\t\t\tqueue[0] = NULL;\n\t\t}\n\t\tif (queue[1]) {\n\t\t\treplay_free(queue[1]);\n\t\t\tqueue[1] = NULL;\n\t\t}\n\t}\n\n\tif (r && (1 <= debug_level) && (end_item != r)) {\n\t\treplay_print_debug(r);\n\t}\n\tdebug(3, \"Leaving parse_provider%s\\n\", \"\");\n\treturn r;\n}\n"
  },
  {
    "path": "pgreplay.1",
    "content": ".TH pgreplay 1 \"\" \"Jun 2011\" \"PostgreSQL Utilities\"\n.SH NAME\npgreplay \\- PostgreSQL log file replayer for performance tests\n.SH SYNOPSIS\n\\fBpgreplay\\fP [\\fIparse options\\fR] [\\fIreplay options\\fR]\n[\\fB-d\\fR \\fIlevel\\fR] [\\fIinfile\\fR]\n.br\n\\fBpgreplay\\fP \\fB-f\\fP [\\fIparse options\\fR] [\\fB-o\\fP \\fIoutfile\\fR]\n[\\fB-d\\fR \\fIlevel\\fR] [\\fIinfile\\fR]\n.br\n\\fBpgreplay\\fP \\fB-r\\fP [\\fIreplay options\\fR] [\\fB-d\\fR \\fIlevel\\fR]\n[\\fIinfile\\fR]\n.SH DESCRIPTION\n\\fBpgreplay\\fR reads a PostgreSQL log file (\\fInot\\fR a WAL file), extracts\nthe SQL statements and executes them in the same order and relative time\nagainst a PostgreSQL database cluster.\nA final report gives you a useful statistical analysis of your workload\nand its execution.\n.P\nIn the first form, the log file \\fIinfile\\fR is replayed at the time it is\nread.\n.P\nWith the \\fB-f\\fR option, \\fBpgreplay\\fR will not execute the statements, but\nwrite them to a \\(oqreplay file\\(cq \\fIoutfile\\fR that can be replayed with\nthe third form.\n.P\nWith the \\fB-r\\fP option, \\fBpgreplay\\fR will execute the statements in the\nreplay file \\fIinfile\\fR that was created by the second form.\n.P\nIf the execution of statements gets behind schedule, warning messages\nare issued that indicate that the server cannot handle the load in a\ntimely fashion.\nThe idea is to replay a real-world database workload as exactly as possible.\n.P\nTo create a log file that can be parsed by \\fBpgreplay\\fR, you need to set the\nfollowing parameters in \\fBpostgresql.conf\\fR:\n.IP\n\\fBlog_min_messages=error\\fR (or more)\n.br\n\\fBlog_min_error_statement=log\\fR (or more)\n.br\n\\fBlog_connections=on\\fR\n.br\n\\fBlog_disconnections=on\\fR\n.br\n\\fBlog_line_prefix=\\(aq%m|%u|%d|%c|\\(aq\\fR (if you don\\(aqt use CSV logging)\n.br\n\\fBlog_statement=\\(aqall\\(aq\\fR\n.br\n\\fBlc_messages\\fR must be set to English (encoding does not matter)\n.br\n\\fBbytea_output=escape\\fR\n(from version 9.0 on, only if you want to replay the log on 8.4 or earlier)\n.P\nThe database cluster against which you replay the SQL statements must be\na clone of the database cluster that generated the logs from the time\n\\fIimmediately before\\fR the logs were generated.\n.P\n\\fBpgreplay\\fR is useful for performance tests, particularly in the following\nsituations:\n.TP 4\n*\nYou want to compare the performance of your PostgreSQL application\non different hardware or different operating systems.\n.TP 4\n*\nYou want to upgrade your database and want to make sure that the new\ndatabase version does not suffer from performance regressions that\naffect you.\n.P\nMoreover, \\fBpgreplay\\fR can give you some feeling as to how your application\n\\fImight\\fR scale by allowing you to try to replay the workload at a higher\nspeed.  Be warned, though, that 500 users working at double speed is not really\nthe same as 1000 users working at normal speed.\n.SH OPTIONS\n.SS Parse options:\n.TP\n\\fB-c\\fR\nSpecifies that the log file is in \\(aqcsvlog\\(aq format (highly recommended)\nand not in \\(aqstderr\\(aq format.\n.TP\n\\fB-b\\fR \\fItimestamp\\fR\nOnly log entries greater or equal to that timestamp will be parsed.\nThe format is \\fBYYYY-MM-DD HH:MM:SS.FFF\\fR like in the log file.\nAn optional time zone part will be ignored.\n.TP\n\\fB-e\\fR \\fItimestamp\\fR\nOnly log entries less or equal to that timestamp will be parsed.\nThe format is \\fBYYYY-MM-DD HH:MM:SS.FFF\\fR like in the log file.\nAn optional time zone part will be ignored.\n.TP\n\\fB-q\\fR\nSpecifies that a backslash in a simple string literal will escape\nthe following single quote.\nThis depends on configuration options like\n\\fBstandard_conforming_strings\\fR and is the default for server\nversion 9.0 and less.\n.TP\n\\fB-D\\fR \\fIdatabase\\fR\nOnly log entries related to the specified database will be parsed\n(this option can be specified multiple times for more than one database).\n.TP\n\\fB-U\\fR \\fIusername\\fR\nOnly log entries related to the specified username will be parsed\n(this option can be specified multiple times for more than one user).\n.SS Replay options:\n.TP\n\\fB-h\\fR \\fIhostname\\fR\nHost name where the target database cluster is running (or directory where\nthe UNIX socket can be found). Defaults to local connections.\n.br\nThis works just like the \\fB-h\\fR option of \\fBpsql\\fR.\n.TP\n\\fB-p\\fR \\fIport\\fR\nTCP port where the target database cluster can be reached.\n.TP\n\\fB-W\\fR \\fIpassword\\fR\nBy default, \\fBpgreplay\\fR assumes that the target database cluster\nis configured for \\fItrust\\fR authentication. With the \\fB-W\\fR option\nyou can specify a password that will be used for all users in the cluster.\n.TP\n\\fB-s\\fR \\fIfactor\\fR\nSpeed factor for replay, by default 1. This can be any valid positive\nfloating point number. A \\fIfactor\\fR less than 1 will replay the workload\nin \\(oqslow motion\\(cq, while a \\fIfactor\\fR greater than 1 means\n\\(oqfast forward\\(cq.\n.TP\n\\fB-E\\fR \\fIencoding\\fR\nSpecifies the encoding of the log file, which will be used as client\nencoding during replay. If it is omitted, your default client encoding will\nbe used.\n.TP\n\\fB-j\\fR\nIf all connections are idle, jump ahead to the next request instead of\nsleeping. This will speed up replay. Execution delays will still be reported\ncorrectly, but replay statistics will not contain the idle time.\n.TP\n\\fB-n\\fR\nDry run mode. No connections to the server are made.\nUseful for checking if the replay file is corrupt or to get statistics\nabout the replay file (number of statements, original duration, ...)\n.TP\n\\fB-X\\fR \\fIoptions\\fR\nExtra connection options for replay connections. These must be libpq\nconnection options specified in the format \\(oqoption=value [...]\\(cq.\n.SS Output options:\n.TP\n\\fB-o\\fP \\fIoutfile\\fR\nspecifies the replay file where the statements will be written\nfor later replay.\n.SS Debug options:\n.TP\n\\fB-d\\fR \\fIlevel\\fR\nSpecifies the trace level (between 1 and 3). Increasing levels will produce\nmore detailed information about what \\fBpgreplay\\fR is doing.\n.TP\n\\fB-v\\fR\nPrints the program version and exits.\n.SH ENVIRONMENT\n.TP\n\\fBPGHOST\\fR\nSpecifies the default value for the \\fB-h\\fR option.\n.TP\n\\fBPGPORT\\fR\nSpecifies the default value for the \\fB-p\\fR option.\n.TP\n\\fBPGCLIENTENCODING\\fR\nSpecifies the default value for the \\fB-E\\fR option.\n.SH LIMITATIONS\n\\fBpgreplay\\fR can only replay what is logged by PostgreSQL.\nThis leads to some limitations:\n.TP 4\n*\n\\fBCOPY\\fR statements will not be replayed, because the copy data are not\nlogged.\n.TP 4\n*\nFast-path API function calls are not logged and will not be replayed.\nUnfortunately, this includes the Large Object API.\n.TP 4\n*\nSince the log file is always in the server encoding (which you can specify\nwith the \\fB-E\\fR switch of \\fBpgreplay\\fR), all\n\\fBSET client_encoding\\fR statements will be ignored.\n.TP 4\n*\nSince the preparation time of prepared statements is not logged (unless\n\\fBlog_min_messages\\fR is \\fBdebug2\\fR or more), these statements will be\nprepared immediately before they are first executed during replay.\n.TP 4\n*\nBecause the log file contains only text, query parameters and return values\nwill always be in text and never in binary format. If you use binary mode to,\nsay, transfer large binary data, \\fBpgreplay\\fR can cause significantly more\nnetwork traffic than the original run.\n.TP 4\n*\nSometimes, if a connection takes longer to complete, the session ID\nunexpectedly changes in the PostgreSQL log file. This causes \\fBpgreplay\\fR\nto treat the session as two different ones, resulting in an additional\nconnection. This is arguably a bug in PostgreSQL.\n.SH AUTHOR\nWritten by Laurenz Albe \\fB<laurenz.albe@cybertec.at>\\fR.\n"
  },
  {
    "path": "pgreplay.h",
    "content": "#ifndef _PGREPLAY_H\n#define _PGREPLAY_H 1\n\n#include \"config.h\"\n\n/* safeguard against broken config.h */\n#ifndef SIZEOF_UNSIGNED_INT\n#\terror SIZEOF_UNSIGNED_INT not defined in config.h.  Please execute 'configure' first!\n#endif\n\n#if defined(WIN32) || defined(WIN64)\n#\tifndef WINDOWS\n#\t\tdefine WINDOWS\n#\tendif\n#endif\n\n#include <stdio.h>\n#include <stdint.h>\n#include <sys/time.h>\n\n/* maximum length of a name in PostgreSQL */\n#define NAMELEN 64\n\n/* types for replay items */\ntypedef enum {\n\tpg_connect = 0,\n\tpg_disconnect,\n\tpg_execute,\n\tpg_prepare,\n\tpg_exec_prepared,\n\tpg_cancel\n} replay_type;\n\n/* one \"command\" parsed from a log file to be replayed\n   the definition is in replay_item.c */\ntypedef struct replay_item replay_item;\n\ntypedef int (replay_item_provider_init)(const char *, int, const char *, const char *, const char *, const char *);\ntypedef replay_item *(replay_item_provider)();\ntypedef void (replay_item_provider_finish)();\n\ntypedef int (replay_item_consumer_init)(const char *, const char *, int, const char *, double);\ntypedef int (replay_item_consumer)(replay_item *);\ntypedef void (replay_item_consumer_finish)(int);\n\n/* hash value for session ID is computed as low byte of background PID */\n#define hash_session(x) (unsigned char)(x & 0xFF);\n\n/* printf/scanf formats for various data types */\n#if SIZEOF_UNSIGNED_INT == 4\n#\tdefine UINT32_FORMAT \"%x\"\n#else\n#\tdefine UINT32_FORMAT \"%hx\"\n#endif\n\n#ifdef HAVE_INTTYPES_H\n#\tinclude <inttypes.h>\n#\tdefine UINT64_FORMAT \"%\" PRIx64\n#else\n/* fall back to guessing */\n#\tifdef WINDOWS\n#\t\tdefine UINT64_FORMAT \"%I64x\"\n#\telse\n#\t\tif SIZEOF_UNSIGNED_LONG == 8\n#\t\t\tdefine UINT64_FORMAT \"%lx\"\n#\t\telse\n#\t\t\tdefine UINT64_FORMAT \"%llx\"\n#\t\tendif\n#\tendif\n#endif\n\n/*********************/\n/* defined in main.c */\n/*********************/\n\nextern int debug_level;\n\n/* destination of statistics output */\nextern FILE *sf;\n\n/* if 1, backslash will escape the following single quote in string literal */\nextern int backslash_quote;\n\n/* if 1, replay will skip idle intervals instead of sleeping */\nextern int jump_enabled;\n\n/* extra connect options specified with the -X option */\nextern char *extra_connstr;\n\n/* print debug messages */\n#define debug(level, format, ...) { \\\n\tif (level <= debug_level) { \\\n\t\tfprintf (stderr, format, __VA_ARGS__); \\\n\t\tfflush(stderr); \\\n\t} \\\n}\n\n/***************************/\n/* defined in replayitem.c */\n/***************************/\n\n/* functions to create replay items */\nextern replay_item *replay_create_connect(const struct timeval *time, uint64_t session_id, const char *user, const char *database);\nextern replay_item *replay_create_disconnect(const struct timeval *time, uint64_t session_id);\nextern replay_item *replay_create_execute(const struct timeval *time, uint64_t session_id, const char *statement);\nextern replay_item *replay_create_prepare(const struct timeval *time, uint64_t session_id, const char *statement, const char *name);\nextern replay_item *replay_create_exec_prepared(const struct timeval *time, uint64_t session_id, const char *name, uint16_t count, char * const *values);\nextern replay_item *replay_create_cancel(const struct timeval *time, uint64_t session_id);\n\n/* free mamory of a replay_item */\nextern void replay_free(replay_item *r);\n\n/* get attributes of a replay item */\nextern replay_type replay_get_type(const replay_item *r);\nextern uint64_t replay_get_session_id(const replay_item *r);\nextern const struct timeval * replay_get_time(const replay_item *r);\nextern const char * replay_get_statement(const replay_item *r);\nextern const char * replay_get_name(const replay_item *r);\nextern const char * replay_get_user(const replay_item *r);\nextern const char * replay_get_database(const replay_item *r);\nextern int replay_get_valuecount(const replay_item *r);\nextern const char * const * replay_get_values(const replay_item *r);\n\n/* dump a replay item at debug level 3 */\nextern void replay_print_debug(const replay_item *r);\n\n/* special replay_item that signals end-of-file */\nextern replay_item * const end_item;\n\n/**********************/\n/* defined in parse.c */\n/**********************/\n\n/* parse a timestamp (excluding time zone) */\nextern const char * parse_time(const char *, struct timeval *);\n\nextern replay_item_provider parse_provider;\nextern replay_item_provider_init parse_provider_init;\nextern replay_item_provider_finish parse_provider_finish;\n\n/***************************/\n/* defined in replayfile.c */\n/***************************/\n\nextern replay_item_provider file_provider;\nextern replay_item_provider_init file_provider_init;\nextern replay_item_provider_finish file_provider_finish;\n\nextern replay_item_consumer file_consumer;\nextern replay_item_consumer_init file_consumer_init;\nextern replay_item_consumer_finish file_consumer_finish;\n\n/*************************/\n/* defined in database.c */\n/*************************/\n\nextern replay_item_consumer database_consumer;\nextern replay_item_consumer database_consumer_dry_run;\nextern replay_item_consumer_init database_consumer_init;\nextern replay_item_consumer_finish database_consumer_finish;\n\n#ifdef WINDOWS\n/************************/\n/* defined in windows.c */\n/************************/\n\nextern void win_perror(const char *prefix, int is_network_error);\n#endif\n\n#endif\n"
  },
  {
    "path": "pgreplay.html",
    "content": "<!-- Creator     : groff version 1.22.4 -->\n<!-- CreationDate: Mon May 22 10:06:02 2023 -->\n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta name=\"generator\" content=\"groff -Thtml, see www.gnu.org\">\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=US-ASCII\">\n<meta name=\"Content-Style\" content=\"text/css\">\n<style type=\"text/css\">\n       p       { margin-top: 0; margin-bottom: 0; vertical-align: top }\n       pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }\n       table   { margin-top: 0; margin-bottom: 0; vertical-align: top }\n       h1      { text-align: center }\n</style>\n<title>pgreplay</title>\n\n</head>\n<body>\n\n<h1 align=\"center\">pgreplay</h1>\n\n<a href=\"#NAME\">NAME</a><br>\n<a href=\"#SYNOPSIS\">SYNOPSIS</a><br>\n<a href=\"#DESCRIPTION\">DESCRIPTION</a><br>\n<a href=\"#OPTIONS\">OPTIONS</a><br>\n<a href=\"#ENVIRONMENT\">ENVIRONMENT</a><br>\n<a href=\"#LIMITATIONS\">LIMITATIONS</a><br>\n<a href=\"#AUTHOR\">AUTHOR</a><br>\n\n<hr>\n\n\n<h2>NAME\n<a name=\"NAME\"></a>\n</h2>\n\n\n<p style=\"margin-left:11%; margin-top: 1em\">pgreplay\n&minus; PostgreSQL log file replayer for performance\ntests</p>\n\n<h2>SYNOPSIS\n<a name=\"SYNOPSIS\"></a>\n</h2>\n\n\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pgreplay</b>\n[<i>parse options</i>] [<i>replay options</i>] [<b>-d</b>\n<i>level</i>] [<i>infile</i>] <b><br>\npgreplay -f</b> [<i>parse options</i>] [<b>-o</b>\n<i>outfile</i>] [<b>-d</b> <i>level</i>] [<i>infile</i>]\n<b><br>\npgreplay -r</b> [<i>replay options</i>] [<b>-d</b>\n<i>level</i>] [<i>infile</i>]</p>\n\n<h2>DESCRIPTION\n<a name=\"DESCRIPTION\"></a>\n</h2>\n\n\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pgreplay</b>\nreads a PostgreSQL log file (<i>not</i> a WAL file),\nextracts the SQL statements and executes them in the same\norder and relative time against a PostgreSQL database\ncluster. A final report gives you a useful statistical\nanalysis of your workload and its execution.</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\">In the first\nform, the log file <i>infile</i> is replayed at the time it\nis read.</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\">With the\n<b>-f</b> option, <b>pgreplay</b> will not execute the\nstatements, but write them to a &lsquo;replay file&rsquo;\n<i>outfile</i> that can be replayed with the third form.</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\">With the\n<b>-r</b> option, <b>pgreplay</b> will execute the\nstatements in the replay file <i>infile</i> that was created\nby the second form.</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\">If the\nexecution of statements gets behind schedule, warning\nmessages are issued that indicate that the server cannot\nhandle the load in a timely fashion. The idea is to replay a\nreal-world database workload as exactly as possible.</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\">To create a log\nfile that can be parsed by <b>pgreplay</b>, you need to set\nthe following parameters in <b>postgresql.conf</b>:</p>\n\n\n<p style=\"margin-left:22%; margin-top: 1em\"><b>log_min_messages=error</b>\n(or more) <b><br>\nlog_min_error_statement=log</b> (or more) <b><br>\nlog_connections=on <br>\nlog_disconnections=on <br>\nlog_line_prefix='%m|%u|%d|%c|'</b> (if you don't use CSV\nlogging) <b><br>\nlog_statement='all' <br>\nlc_messages</b> must be set to English (encoding does not\nmatter) <b><br>\nbytea_output=escape</b> (from version 9.0 on, only if you\nwant to replay the log on 8.4 or earlier)</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\">The database\ncluster against which you replay the SQL statements must be\na clone of the database cluster that generated the logs from\nthe time <i>immediately before</i> the logs were\ngenerated.</p>\n\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pgreplay</b>\nis useful for performance tests, particularly in the\nfollowing situations:</p>\n\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\"\n       cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p>You want to compare the performance of your PostgreSQL\napplication on different hardware or different operating\nsystems.</p> </td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p>You want to upgrade your database and want to make sure\nthat the new database version does not suffer from\nperformance regressions that affect you.</p></td></tr>\n</table>\n\n<p style=\"margin-left:11%; margin-top: 1em\">Moreover,\n<b>pgreplay</b> can give you some feeling as to how your\napplication <i>might</i> scale by allowing you to try to\nreplay the workload at a higher speed. Be warned, though,\nthat 500 users working at double speed is not really the\nsame as 1000 users working at normal speed.</p>\n\n<h2>OPTIONS\n<a name=\"OPTIONS\"></a>\n</h2>\n\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Parse\noptions:</b></p>\n\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\"\n       cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"3%\">\n\n\n<p style=\"margin-top: 1em\"><b>-c</b></p></td>\n<td width=\"8%\"></td>\n<td width=\"78%\">\n\n\n<p style=\"margin-top: 1em\">Specifies that the log file is\nin 'csvlog' format (highly recommended) and not in 'stderr'\nformat.</p> </td></tr>\n</table>\n\n<p style=\"margin-left:11%;\"><b>-b</b> <i>timestamp</i></p>\n\n<p style=\"margin-left:22%;\">Only log entries greater or\nequal to that timestamp will be parsed. The format is\n<b>YYYY-MM-DD HH:MM:SS.FFF</b> like in the log file. An\noptional time zone part will be ignored.</p>\n\n<p style=\"margin-left:11%;\"><b>-e</b> <i>timestamp</i></p>\n\n<p style=\"margin-left:22%;\">Only log entries less or equal\nto that timestamp will be parsed. The format is\n<b>YYYY-MM-DD HH:MM:SS.FFF</b> like in the log file. An\noptional time zone part will be ignored.</p>\n\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\"\n       cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"3%\">\n\n\n<p><b>-q</b></p></td>\n<td width=\"8%\"></td>\n<td width=\"78%\">\n\n\n<p>Specifies that a backslash in a simple string literal\nwill escape the following single quote. This depends on\nconfiguration options like\n<b>standard_conforming_strings</b> and is the default for\nserver version 9.0 and less.</p></td></tr>\n</table>\n\n<p style=\"margin-left:11%;\"><b>-D</b> <i>database</i></p>\n\n<p style=\"margin-left:22%;\">Only log entries related to the\nspecified database will be parsed (this option can be\nspecified multiple times for more than one database).</p>\n\n<p style=\"margin-left:11%;\"><b>-U</b> <i>username</i></p>\n\n<p style=\"margin-left:22%;\">Only log entries related to the\nspecified username will be parsed (this option can be\nspecified multiple times for more than one user).</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Replay\noptions: <br>\n-h</b> <i>hostname</i></p>\n\n<p style=\"margin-left:22%;\">Host name where the target\ndatabase cluster is running (or directory where the UNIX\nsocket can be found). Defaults to local connections. <br>\nThis works just like the <b>-h</b> option of\n<b>psql</b>.</p>\n\n<p style=\"margin-left:11%;\"><b>-p</b> <i>port</i></p>\n\n<p style=\"margin-left:22%;\">TCP port where the target\ndatabase cluster can be reached.</p>\n\n<p style=\"margin-left:11%;\"><b>-W</b> <i>password</i></p>\n\n<p style=\"margin-left:22%;\">By default, <b>pgreplay</b>\nassumes that the target database cluster is configured for\n<i>trust</i> authentication. With the <b>-W</b> option you\ncan specify a password that will be used for all users in\nthe cluster.</p>\n\n<p style=\"margin-left:11%;\"><b>-s</b> <i>factor</i></p>\n\n<p style=\"margin-left:22%;\">Speed factor for replay, by\ndefault 1. This can be any valid positive floating point\nnumber. A <i>factor</i> less than 1 will replay the workload\nin &lsquo;slow motion&rsquo;, while a <i>factor</i> greater\nthan 1 means &lsquo;fast forward&rsquo;.</p>\n\n<p style=\"margin-left:11%;\"><b>-E</b> <i>encoding</i></p>\n\n<p style=\"margin-left:22%;\">Specifies the encoding of the\nlog file, which will be used as client encoding during\nreplay. If it is omitted, your default client encoding will\nbe used.</p>\n\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\"\n       cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"3%\">\n\n\n<p><b>-j</b></p></td>\n<td width=\"8%\"></td>\n<td width=\"78%\">\n\n\n<p>If all connections are idle, jump ahead to the next\nrequest instead of sleeping. This will speed up replay.\nExecution delays will still be reported correctly, but\nreplay statistics will not contain the idle time.</p></td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"3%\">\n\n\n<p><b>-n</b></p></td>\n<td width=\"8%\"></td>\n<td width=\"78%\">\n\n\n<p>Dry run mode. No connections to the server are made.\nUseful for checking if the replay file is corrupt or to get\nstatistics about the replay file (number of statements,\noriginal duration, ...)</p></td></tr>\n</table>\n\n<p style=\"margin-left:11%;\"><b>-X</b> <i>options</i></p>\n\n<p style=\"margin-left:22%;\">Extra connection options for\nreplay connections. These must be libpq connection options\nspecified in the format &lsquo;option=value\n[...]&rsquo;.</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Output\noptions: <br>\n-o</b> <i>outfile</i></p>\n\n<p style=\"margin-left:22%;\">specifies the replay file where\nthe statements will be written for later replay.</p>\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Debug\noptions: <br>\n-d</b> <i>level</i></p>\n\n<p style=\"margin-left:22%;\">Specifies the trace level\n(between 1 and 3). Increasing levels will produce more\ndetailed information about what <b>pgreplay</b> is\ndoing.</p>\n\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\"\n       cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"3%\">\n\n\n<p><b>-v</b></p></td>\n<td width=\"8%\"></td>\n<td width=\"56%\">\n\n\n<p>Prints the program version and exits.</p></td>\n<td width=\"22%\">\n</td></tr>\n</table>\n\n<h2>ENVIRONMENT\n<a name=\"ENVIRONMENT\"></a>\n</h2>\n\n\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\"\n       cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"9%\">\n\n\n<p style=\"margin-top: 1em\"><b>PGHOST</b></p></td>\n<td width=\"2%\"></td>\n<td width=\"70%\">\n\n\n<p style=\"margin-top: 1em\">Specifies the default value for\nthe <b>-h</b> option.</p></td>\n<td width=\"8%\">\n</td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"9%\">\n\n\n<p><b>PGPORT</b></p></td>\n<td width=\"2%\"></td>\n<td width=\"70%\">\n\n\n<p>Specifies the default value for the <b>-p</b>\noption.</p> </td>\n<td width=\"8%\">\n</td></tr>\n</table>\n\n<p style=\"margin-left:11%;\"><b>PGCLIENTENCODING</b></p>\n\n<p style=\"margin-left:22%;\">Specifies the default value for\nthe <b>-E</b> option.</p>\n\n<h2>LIMITATIONS\n<a name=\"LIMITATIONS\"></a>\n</h2>\n\n\n\n<p style=\"margin-left:11%; margin-top: 1em\"><b>pgreplay</b>\ncan only replay what is logged by PostgreSQL. This leads to\nsome limitations:</p>\n\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\"\n       cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p><b>COPY</b> statements will not be replayed, because the\ncopy data are not logged.</p></td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p>Fast-path API function calls are not logged and will not\nbe replayed. Unfortunately, this includes the Large Object\nAPI.</p> </td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p>Since the log file is always in the server encoding\n(which you can specify with the <b>-E</b> switch of\n<b>pgreplay</b>), all <b>SET client_encoding</b> statements\nwill be ignored.</p></td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p>Since the preparation time of prepared statements is not\nlogged (unless <b>log_min_messages</b> is <b>debug2</b> or\nmore), these statements will be prepared immediately before\nthey are first executed during replay.</p></td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p>Because the log file contains only text, query\nparameters and return values will always be in text and\nnever in binary format. If you use binary mode to, say,\ntransfer large binary data, <b>pgreplay</b> can cause\nsignificantly more network traffic than the original\nrun.</p> </td></tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"></td>\n<td width=\"1%\">\n\n\n<p>*</p></td>\n<td width=\"5%\"></td>\n<td width=\"83%\">\n\n\n<p>Sometimes, if a connection takes longer to complete, the\nsession ID unexpectedly changes in the PostgreSQL log file.\nThis causes <b>pgreplay</b> to treat the session as two\ndifferent ones, resulting in an additional connection. This\nis arguably a bug in PostgreSQL.</p></td></tr>\n</table>\n\n<h2>AUTHOR\n<a name=\"AUTHOR\"></a>\n</h2>\n\n\n<p style=\"margin-left:11%; margin-top: 1em\">Written by\nLaurenz Albe <b>&lt;laurenz.albe@cybertec.at&gt;</b>.</p>\n<hr>\n</body>\n</html>\n"
  },
  {
    "path": "replayfile.c",
    "content": "#include \"pgreplay.h\"\n\n#include <stdio.h>\n#include <unistd.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/time.h>\n#ifdef WINDOWS\n#\tinclude <io.h>\n#\tinclude <winsock.h>\n#\tdefine FILE_MODE S_IRUSR | S_IWUSR\n#else\n#\tifdef HAVE_NETINET_IN_H\n#\t\tinclude <netinet/in.h>\n#\tendif\n#\tdefine FILE_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH\n#endif\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <fcntl.h>\n\n/* input or output file */\nstatic int filed=0;\n\n/* functions to convert 64-bit integers between host and network byte order */\n#ifndef htonll\n#\tifdef WORDS_BIGENDIAN\n#\t\tdefine htonll(x) (x)\n#\t\tdefine ntohll(x) (x)\n#\telse\n#\t\tdefine htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl(x >> 32))\n#\t\tdefine ntohll(x) ((((uint64_t)ntohl(x)) << 32) + ntohl(x >> 32))\n#\tendif\n#endif\n\n/* this length indicates a null value */\n#define NULL_VALUE 0x80000000\n\n/* wrapper functions for read and write */\nstatic int do_write(const void * const buf, size_t count) {\n\tint rc = write(filed, buf, count);\n\n\tif (-1 == rc) {\n\t\tperror(\"Error writing to output file\");\n\t\treturn 0;\n\t} else if (count != rc) {\n\t\tfprintf(stderr, \"Error: not all bytes written to output file\\n\");\n\t\treturn 0;\n\t}\n\n\treturn 1;\n}\n\nstatic int do_read(void *buf, size_t count, int *eof_indicator) {\n\tint rc = read(filed, buf, count);\n\n\tif (eof_indicator) {\n\t\t*eof_indicator = 0;\n\t}\n\n\tif (-1 == rc) {\n\t\tperror(\"Error reading from input file\");\n\t\treturn 0;\n\t} else if (eof_indicator && (0 == rc)) {\n\t\t*eof_indicator = 1;\n\t} else if (count != rc) {\n\t\tfprintf(stderr, \"Error: unexpected end of file on input file\\n\");\n\t\treturn 0;\n\t}\n\n\treturn 1;\n}\n\n/* write a string to the output file */\nstatic int write_string(char const * const s) {\n\tuint32_t u32, len;\n\n\t/* write length + NULL indicator (4 byte) */\n\tif (NULL == s) {\n\t\tlen = NULL_VALUE;\n\t} else {\n\t\tlen = strlen(s);\n\t}\n\tu32 = htonl(len);\n\tif (! do_write(&u32, 4)) {\n\t\treturn 0;\n\t} else if (NULL != s) {\n\t\t/* write string */\n\t\tif (! do_write(s, len)) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\treturn 1;\n}\n\n/* malloc and read a string from the input file */\nstatic int read_string(char ** const s) {\n\tuint32_t u32, len;\n\n\t/* read length (4 byte) */\n\tif (! do_read(&u32, 4, NULL)) {\n\t\treturn 0;\n\t}\n\tlen = ntohl(u32);\n\tif (NULL_VALUE == len) {\n\t\t*s = NULL;\n\t} else {\n\t\t/* allocate the string */\n\t\tif (! (*s = malloc(len + 1))) {\n\t\t\tfprintf(stderr, \"Cannot allocate %d bytes of memory\\n\", len + 1);\n\t\t\treturn 0;\n\t\t} else {\n\t\t\t/* read string */\n\t\t\tif (! do_read(*s, len, NULL)) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t(*s)[len] = '\\0';\n\t\t}\n\t}\n\n\treturn 1;\n}\n\nint file_provider_init(const char *infile, int cvs, const char *begin_time, const char *end_time, const char *db_only, const char *usr_only) {\n\tint rc = 1;\n\tdebug(3, \"Entering file_provider_init%s\\n\", \"\");\n\n\tif (NULL == infile) {\n\t\tfiled = 0;\n#ifdef WINDOWS\n\t\tsetmode(filed, O_BINARY);\n#endif\n\t} else {\n\t\tif (-1 == (filed = open(infile, O_RDONLY\n#ifdef WINDOWS\n\t\t\t\t\t| O_BINARY\n#endif\n\t\t\t\t\t))) {\n\t\t\tperror(\"Error opening input file:\");\n\t\t\trc = 0;\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving file_provider_init%s\\n\", \"\");\n\n\treturn rc;\n}\n\nvoid file_provider_finish() {\n\tdebug(3, \"Entering file_provider_finish%s\\n\", \"\");\n\n\tif (0 != filed) {\n\t\tif (close(filed)) {\n\t\t\tperror(\"Error closing input file:\");\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving file_provider_finish%s\\n\", \"\");\n}\n\nreplay_item * file_provider() {\n\treplay_item *r = NULL;\n\tuint16_t u16;\n\tuint32_t u32;\n\tuint64_t u64, session_id = 0;\n\tstruct timeval tv;\n\treplay_type type = -1;\n\tint ok = 1, i = 0, eof;\n\tunsigned long count;\n\tchar *user, *database, *statement, *name, **values, nl;\n\n\tdebug(3, \"Entering file_provider%s\\n\", \"\");\n\n\t/* read timestamp (8 byte) */\n\tif (! do_read(&u32, 4, &eof)) {\n\t\tok = 0;\n\t} else {\n\t\t/* handle expected end-of-file condition */\n\t\tif (eof) {\n\t\t\treturn end_item;\n\t\t}\n\n\t\ttv.tv_sec = ntohl(u32);\n\t\tif (! do_read(&u32, 4, NULL)) {\n\t\t\tok = 0;\n\t\t} else {\n\t\t\ttv.tv_usec = ntohl(u32);\n\t\t}\n\t}\n\n\t/* read session_id (8 byte) */\n\tif (ok && do_read(&u64, 8, NULL)) {\n\t\tsession_id = ntohll(u64);\n\t} else {\n\t\tok = 0;\n\t}\n\n\t/* read type (1 byte) */\n\tif (ok) {\n\t\tu16 = 0;\n\t\tif (! do_read((char *)(&u16) + 1, 1, NULL)) {\n\t\t\tok = 0;\n\t\t} else {\n\t\t\ttype = ntohs(u16);\n\t\t\tif ((type < pg_connect) || (type > pg_cancel)) {\n\t\t\t\tfprintf(stderr, \"Error: unknown type %u encountered\\n\", type);\n\t\t\t\tok = 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t/* read type specific stuff */\n\tif (ok) {\n\t\tswitch (type) {\n\t\t\tcase pg_connect:\n\t\t\t\tif (read_string(&user)) {\n\t\t\t\t\tif (read_string(&database)) {\n\t\t\t\t\t\tr = replay_create_connect(&tv, session_id, user, database);\n\t\t\t\t\t\tfree(database);\n\t\t\t\t\t}\n\t\t\t\t\tfree(user);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_disconnect:\n\t\t\t\tr = replay_create_disconnect(&tv, session_id);\n\t\t\t\tbreak;\n\t\t\tcase pg_execute:\n\t\t\t\tif (read_string(&statement)) {\n\t\t\t\t\tr = replay_create_execute(&tv, session_id, statement);\n\t\t\t\t\tfree(statement);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_prepare:\n\t\t\t\tif (read_string(&statement)) {\n\t\t\t\t\tif (read_string(&name)) {\n\t\t\t\t\t\tr = replay_create_prepare(&tv, session_id, name, statement);\n\t\t\t\t\t\tfree(name);\n\t\t\t\t\t}\n\t\t\t\t\tfree(statement);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_exec_prepared:\n\t\t\t\t/* read statement name */\n\t\t\t\tif (read_string(&name)) {\n\t\t\t\t\t/* number of bind arguments (2 byte) */\n\t\t\t\t\tif (do_read(&u16, 2, NULL)) {\n\t\t\t\t\t\tcount = ntohs(u16);\n\t\t\t\t\t\tif (NULL == (values = calloc(count, sizeof(char *)))) {\n\t\t\t\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", count * sizeof(char *));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t/* read bind values */\n\t\t\t\t\t\t\twhile (i < count) {\n\t\t\t\t\t\t\t\tif (read_string(values + i)) {\n\t\t\t\t\t\t\t\t\t++i;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (i == count) {\n\t\t\t\t\t\t\t\tr = replay_create_exec_prepared(&tv, session_id, name, count, values);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twhile (--i >= 0) {\n\t\t\t\t\t\t\t\tif (values[i]) {\n\t\t\t\t\t\t\t\t\tfree(values[i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfree(values);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfree(name);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_cancel:\n\t\t\t\tr = replay_create_cancel(&tv, session_id);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* read new-line at the end of the record */\n\tif (r && do_read(&nl, 1, NULL) && ('\\n' != nl)) {\n\t\tfprintf(stderr, \"Error: missing new-line at end of line\\n\");\n\t\tif (r) {\n\t\t\treplay_free(r);\n\t\t\tr = NULL;\n\t\t}\n\t}\n\n\tif (r && (1 <= debug_level) && (end_item != r)) {\n\t\treplay_print_debug(r);\n\t}\n\n\tdebug(3, \"Leaving file_provider%s\\n\", \"\");\n\n    return r;\n}\n\nint file_consumer_init(const char *outfile, const char *host, int port, const char *passwd, double factor) {\n\tdebug(3, \"Entering file_consumer_init%s\\n\", \"\");\n\n\tif ((NULL == outfile) || ('\\0' == outfile[0])\n\t\t\t|| (('-' == outfile[0]) && ('\\0' == outfile[1]))) {\n\t\tfiled = 1;\n#ifdef WINDOWS\n\t\t/* set stdout to binary mode */\n\t\tsetmode(filed, O_BINARY);\n#endif\n\t} else {\n\t\tif (-1 == (filed = open(outfile, O_WRONLY | O_CREAT | O_TRUNC\n#ifdef WINDOWS\n\t\t\t\t\t| O_BINARY\n#endif\n\t\t\t\t\t, FILE_MODE))) {\n\t\t\tperror(\"Error opening output file:\");\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving file_consumer_init%s\\n\", \"\");\n\treturn 1;\n}\n\nvoid file_consumer_finish(int dry_run) {\n\tdebug(3, \"Entering file_consumer_finish%s\\n\", \"\");\n\n\tif (1 != filed) {\n\t\tif (close(filed)) {\n\t\t\tperror(\"Error closing output file:\");\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving file_consumer_finish%s\\n\", \"\");\n}\n\nint file_consumer(replay_item *item) {\n\tconst struct timeval *tv = replay_get_time(item);\n\tuint16_t count;\n\tconst replay_type type = replay_get_type(item);\n\tuint16_t u16, i;\n\tuint32_t u32;\n\tuint64_t u64;\n\tint rc = 1;\n\tconst char * const *values;\n\n\tdebug(3, \"Entering file_consumer%s\\n\", \"\");\n\n\t/* write timestamp (8 byte) */\n\tu32 = htonl(tv->tv_sec);\n\tif (! do_write(&u32, 4)) {\n\t\trc = -1;\n\t} else {\n\t\tu32 = htonl(tv->tv_usec);\n\t\tif (! do_write(&u32, 4)) {\n\t\t\trc = -1;\n\t\t}\n\t}\n\n\t/* write session_id (8 byte) */\n\tif (1 == rc) {\n\t\tu64 = htonll(replay_get_session_id(item));\n\t\tif (! do_write(&u64, 8)) {\n\t\t\trc = -1;\n\t\t}\n\t}\n\n\t/* write type (1 byte) */\n\tif (1 == rc) {\n\t\tu16 = htons((uint16_t) type);\n\t\tif (! do_write((char *)(&u16) + 1, 1)) {\n\t\t\trc = -1;\n\t\t}\n\t}\n\n\t/* write type specific stuff */\n\tif (1 == rc) {\n\t\tswitch (type) {\n\t\t\tcase pg_connect:\n\t\t\t\tif (! write_string(replay_get_user(item))) {\n\t\t\t\t\trc = -1;\n\t\t\t\t} else if (! write_string(replay_get_database(item))) {\n\t\t\t\t\trc = -1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_disconnect:\n\t\t\t\tbreak;\n\t\t\tcase pg_execute:\n\t\t\t\tif (! write_string(replay_get_statement(item))) {\n\t\t\t\t\trc = -1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_prepare:\n\t\t\t\tif (! write_string(replay_get_statement(item))) {\n\t\t\t\t\trc = -1;\n\t\t\t\t} else if (! write_string(replay_get_name(item))) {\n\t\t\t\t\trc = -1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_exec_prepared:\n\t\t\t\tcount = replay_get_valuecount(item);\n\t\t\t\t/* write statement name */\n\t\t\t\tif (! write_string(replay_get_name(item))) {\n\t\t\t\t\trc = -1;\n\t\t\t\t} else {\n\t\t\t\t\t/* write count (2 byte) */\n\t\t\t\t\tu16 = htons(count);\n\t\t\t\t\tif (! do_write(&u16, 2)) {\n\t\t\t\t\t\trc = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* write values */\n\t\t\t\t\t\tvalues = replay_get_values(item);\n\t\t\t\t\t\tfor (i=0; i<count; ++i) {\n\t\t\t\t\t\t\tif (! write_string(values[i])) {\n\t\t\t\t\t\t\t\trc = -1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase pg_cancel:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* write new-line (1 byte) */\n\tif (1 == rc) {\n\t\tif (! do_write(\"\\n\", 1)) {\n\t\t\trc = -1;\n\t\t}\n\t}\n\n\treplay_free(item);\n\n\tdebug(3, \"Leaving file_consumer%s\\n\", \"\");\n\treturn rc;\n}\n"
  },
  {
    "path": "replayitem.c",
    "content": "#include \"pgreplay.h\"\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <assert.h>\n#include <sys/time.h>\n\n/* type for one replay line */\nstruct replay_item {\n\tstruct timeval time;\n\tuint64_t session_id;\n\treplay_type type;\n\tuint16_t count;\n\tchar **data;\n};\n\n/* special replay_item that signals end-of-file */\nstatic replay_item end_replay_item = {{0, 0}, 0, -1, 0, NULL};\nreplay_item * const end_item = &end_replay_item;\n\n/* create common part of a replay_item */\nstatic replay_item *replay_create(const struct timeval *time, uint64_t session_id, replay_type type, uint16_t count) {\n\treplay_item *r;\n\n\tr = malloc(sizeof(struct replay_item));\n\tif (NULL == r) {\n\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)sizeof(struct replay_item));\n\t\treturn NULL;\n\t}\n\tr->time.tv_sec  = time->tv_sec;\n\tr->time.tv_usec = time->tv_usec;\n\tr->session_id   = session_id;\n\tr->type         = type;\n\tr->count        = count;\n\tif (0 == count) {\n\t\tr->data = NULL;\n\t} else {\n\t\tr->data = calloc(count, sizeof(char *));\n\t\tif (NULL == r->data) {\n\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)count * sizeof(char *));\n\t\t\tfree(r);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\treturn r;\n}\n\nreplay_item *replay_create_connect(const struct timeval *time, uint64_t session_id, const char *user, const char *database) {\n\treplay_item *r;\n\n\tdebug(3, \"Entering replay_create_connect%s\\n\", \"\");\n\n\tr = replay_create(time, session_id, pg_connect, 2);\n\tif (NULL == r) {\n\t\treturn NULL;\n\t}\n\n\t(r->data)[0] = malloc(strlen(user) + 1);\n\tif (NULL == (r->data)[0]) {\n\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(user) + 1);\n\t\tfree(r->data);\n\t\tfree(r);\n\t\treturn NULL;\n\t}\n\tstrcpy((r->data)[0], user);\n\n\t(r->data)[1] = malloc(strlen(database) + 1);\n\tif (NULL == (r->data)[1]) {\n\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(user) + 1);\n\t\tfree((r->data)[0]);\n\t\tfree(r->data);\n\t\tfree(r);\n\t\treturn NULL;\n\t}\n\tstrcpy((r->data)[1], database);\n\n\tdebug(3, \"Leaving replay_create_connect%s\\n\", \"\");\n\treturn r;\n}\n\nreplay_item *replay_create_disconnect(const struct timeval *time, uint64_t session_id) {\n\treplay_item *r;\n\n\tdebug(3, \"Entering replay_create_disconnect%s\\n\", \"\");\n\n\tr = replay_create(time, session_id, pg_disconnect, 0);\n\tif (NULL == r) {\n\t\treturn NULL;\n\t}\n\tdebug(3, \"Leaving replay_create_disconnect%s\\n\", \"\");\n\treturn r;\n}\n\nreplay_item *replay_create_execute(const struct timeval *time, uint64_t session_id, const char *statement) {\n\treplay_item *r;\n\n\tdebug(3, \"Entering replay_create_execute%s\\n\", \"\");\n\n\tr = replay_create(time, session_id, pg_execute, 1);\n\tif (NULL == r) {\n\t\treturn NULL;\n\t}\n\n\t(r->data)[0] = malloc(strlen(statement) + 1);\n\tif (NULL == (r->data)[0]) {\n\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(statement) + 1);\n\t\tfree(r->data);\n\t\tfree(r);\n\t\treturn NULL;\n\t}\n\tstrcpy((r->data)[0], statement);\n\n\tdebug(3, \"Leaving replay_create_execute%s\\n\", \"\");\n\treturn r;\n}\n\nreplay_item *replay_create_prepare(const struct timeval *time, uint64_t session_id, const char *name, const char *statement) {\n\treplay_item *r;\n\n\tdebug(3, \"Entering replay_create_prepare%s\\n\", \"\");\n\n\tr = replay_create(time, session_id, pg_prepare, 2);\n\tif (NULL == r) {\n\t\treturn NULL;\n\t}\n\n\t(r->data)[0] = malloc(strlen(statement) + 1);\n\tif (NULL == (r->data)[0]) {\n\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(statement) + 1);\n\t\tfree(r->data);\n\t\tfree(r);\n\t\treturn NULL;\n\t}\n\tstrcpy((r->data)[0], statement);\n\n\t(r->data)[1] = malloc(strlen(name) + 1);\n\tif (NULL == (r->data)[1]) {\n\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(name) + 1);\n\t\tfree((r->data)[0]);\n\t\tfree(r->data);\n\t\tfree(r);\n\t\treturn NULL;\n\t}\n\tstrcpy((r->data)[1], name);\n\n\tdebug(3, \"Leaving replay_create_prepare%s\\n\", \"\");\n\treturn r;\n}\n\nreplay_item *replay_create_exec_prepared(const struct timeval *time, uint64_t session_id, const char*name, uint16_t count, char * const *values) {\n\treplay_item *r;\n\tint i;\n\n\tdebug(3, \"Entering replay_create_exec_prepared%s\\n\", \"\");\n\n\tr = replay_create(time, session_id, pg_exec_prepared, count + 1);\n\tif (NULL == r) {\n\t\treturn NULL;\n\t}\n\n\t(r->data)[0] = malloc(strlen(name) + 1);\n\tif (NULL == (r->data)[0]) {\n\t\tfree(r->data);\n\t\tfree(r);\n\t\treturn NULL;\n\t}\n\tstrcpy((r->data)[0], name);\n\n\tfor (i=1; i<count+1; ++i) {\n\t\tif (values[i-1]) {\n\t\t\t(r->data)[i] = malloc(strlen(values[i-1]) + 1);\n\t\t\tif (NULL == (r->data)[i]) {\n\t\t\t\tfprintf(stderr, \"Cannot allocate %lu bytes of memory\\n\", (unsigned long)strlen(values[i-1]) + 1);\n\t\t\t\tfor (--i; i>=0; --i) {\n\t\t\t\t\tif ((r->data)[i]) {\n\t\t\t\t\t\tfree((r->data)[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfree(r->data);\n\t\t\t\tfree(r);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t\tstrcpy((r->data)[i], values[i-1]);\n\t\t} else {\n\t\t\t(r->data)[i] = NULL;\n\t\t}\n\t}\n\n\tdebug(3, \"Leaving replay_create_exec_prepared%s\\n\", \"\");\n\treturn r;\n}\n\nreplay_item *replay_create_cancel(const struct timeval *time, uint64_t session_id) {\n\treplay_item *r;\n\n\tdebug(3, \"Entering replay_create_cancel%s\\n\", \"\");\n\n\tr = replay_create(time, session_id, pg_cancel, 0);\n\tif (NULL == r) {\n\t\treturn NULL;\n\t}\n\tdebug(3, \"Leaving replay_create_cancel%s\\n\", \"\");\n\treturn r;\n}\n\nvoid replay_free(replay_item *r) {\n\tint i;\n\n\tdebug(3, \"Entering replay_free%s\\n\", \"\");\n\n\tassert((pg_connect == r->type) || (pg_disconnect == r->type) || (pg_execute == r->type) || (pg_prepare == r->type) || (pg_exec_prepared == r->type) || (pg_cancel == r->type));\n\n\tfor (i=0; i<r->count; ++i) {\n\t\tif ((r->data)[i]) {\n\t\t\tfree((r->data)[i]);\n\t\t}\n\t}\n\tif (r->count) {\n\t\tfree(r->data);\n\t}\n\tfree(r);\n\n\tdebug(3, \"Leaving replay_free%s\\n\", \"\");\n}\n\nreplay_type replay_get_type(const replay_item *r) {\n\treturn r->type;\n}\n\nuint64_t replay_get_session_id(const replay_item *r) {\n\treturn r->session_id;\n}\n\nconst struct timeval * replay_get_time(const replay_item *r) {\n\treturn &(r->time);\n}\n\nconst char * replay_get_statement(const replay_item *r) {\n\tassert((pg_execute == r->type) || (pg_prepare == r->type));\n\n\treturn (r->data)[0];\n}\n\nconst char * replay_get_name(const replay_item *r) {\n\tassert((pg_prepare == r->type) || (pg_exec_prepared == r->type));\n\n\treturn (pg_prepare == r->type) ? (r->data)[1] : (r->data)[0];\n}\n\nconst char * replay_get_user(const replay_item *r) {\n\tassert(pg_connect == r->type);\n\n\treturn (r->data)[0];\n}\n\nconst char * replay_get_database(const replay_item *r) {\n\tassert(pg_connect == r->type);\n\n\treturn (r->data)[1];\n}\n\nint replay_get_valuecount(const replay_item *r) {\n\tassert(pg_exec_prepared == r->type);\n\n\treturn r->count - 1;\n}\n\nconst char * const * replay_get_values(const replay_item *r) {\n\tassert(pg_exec_prepared == r->type);\n\n\treturn (const char * const *)((r->data) + 1);\n}\n\n/* maximal part of a value for display */\n#define SAMPLE_SIZE 100\n\nvoid replay_print_debug(const replay_item *r) {\n\treplay_type type;\n\tint i;\n\tchar valuepart[SAMPLE_SIZE+4], *p;\n\n\tvaluepart[SAMPLE_SIZE] = '.';\n\tvaluepart[SAMPLE_SIZE+1] = '.';\n\tvaluepart[SAMPLE_SIZE+2] = '.';\n\tvaluepart[SAMPLE_SIZE+3] = '\\0';\n\n\tdebug(1, \"---------------------------%s\\n\", \"\");\n\tdebug(1, \"Item: time       = %lu.%06lu\\n\", (unsigned long)r->time.tv_sec, (unsigned long)r->time.tv_usec);\n\tdebug(1, \"      session id = 0x\" UINT64_FORMAT \"\\n\", r->session_id);\n\ttype = r->type;\n\tdebug(1, \"      type       = %s\\n\",\n\t\t(pg_connect == type) ? \"connect\" :\n\t\t\t((pg_disconnect == type) ? \"disconnect\" :\n\t\t\t\t((pg_execute == type) ? \"execute\" :\n\t\t\t\t\t((pg_prepare == type) ? \"prepare\" :\n\t\t\t\t\t\t((pg_exec_prepared == type) ? \"exec_prepared\" :\n\t\t\t\t\t\t\t((pg_cancel == type) ? \"cancel\" : \"unknown\")\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t);\n\tswitch (type) {\n\t\tcase pg_connect:\n\t\t\tdebug(1, \"      user       = %s\\n\", replay_get_user(r));\n\t\t\tdebug(1, \"      database   = %s\\n\", replay_get_database(r));\n\t\tcase pg_disconnect:\n\t\tcase pg_cancel:\n\t\t\tbreak;\n\t\tcase pg_prepare:\n\t\t\tdebug(1, \"      name       = %s\\n\", replay_get_name(r));\n\t\tcase pg_execute:\n\t\t\tdebug(1, \"      statement  = %s\\n\", replay_get_statement(r));\n\t\t\tbreak;\n\t\tcase pg_exec_prepared:\n\t\t\tdebug(1, \"      name       = %s\\n\", replay_get_name(r));\n\t\t\tfor (i=0; i<replay_get_valuecount(r); ++i) {\n\t\t\t\t/* print only the first SAMPLE_SIZE bytes of the argument */\n\t\t\t\tif (replay_get_values(r)[i]) {\n\t\t\t\t\tstrncpy(valuepart, replay_get_values(r)[i], SAMPLE_SIZE);\n\t\t\t\t\tp = valuepart;\n\t\t\t\t} else {\n\t\t\t\t\tp = NULL;\n\t\t\t\t}\n\t\t\t\tdebug(1, \"      $%d         = %s\\n\", i + 1, (NULL == p) ? \"(null)\" : p);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\tdebug(1, \"---------------------------%s\\n\", \"\");\n}\n"
  },
  {
    "path": "windows.c",
    "content": "#include \"pgreplay.h\"\n#include <windows.h>\n#include <stdio.h>\n\n/* gets the last error and prints an error message */\n\nvoid win_perror(const char *prefix, int is_network_error) {\n\tDWORD error_nr;\n\tchar *errmsg;\n\t/* catalog of Windows socket error messages */\n\tstatic HMODULE sock_err_mod = NULL;\n\n\t/* get the message number */\n\tif (is_network_error) {\n\t\terror_nr = WSAGetLastError();\n\n\t\tif (NULL == sock_err_mod) {\n\t\t\t/* try to load the Windows socket error message catalog */\n\t\t\tsock_err_mod = LoadLibraryEx(\n\t\t\t\t\t\"netmsg.dll\",\n\t\t\t\t\tNULL,\n\t\t\t\t\tLOAD_LIBRARY_AS_DATAFILE\n\t\t\t\t);\n\t\t}\n\t} else {\n\t\terror_nr = GetLastError();\n\t}\n\n\t/* get the error message text */\n\tif (FormatMessage(\n\t\t\tFORMAT_MESSAGE_ALLOCATE_BUFFER\n\t\t\t\t| FORMAT_MESSAGE_IGNORE_INSERTS\n\t\t\t\t| FORMAT_MESSAGE_FROM_SYSTEM\n\t\t\t\t| ((is_network_error && sock_err_mod) ? FORMAT_MESSAGE_FROM_HMODULE : 0),\n\t\t\tsock_err_mod,\n\t\t\terror_nr,\n\t\t\tMAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\n\t\t\t(LPSTR) &errmsg,\n\t\t\t0,\n\t\t\tNULL)) {\n\t\tfprintf(stderr, \"%s: %s\\n\", prefix, errmsg);\n\n\t\t/* free the memory for the error message */\n\t\tLocalFree(errmsg);\n\t} else {\n\t\tfprintf(stderr, \"%s: error number %ld\\n\", prefix, error_nr);\n\t}\n}\n"
  }
]