pax_global_header00006660000000000000000000000064135006543270014517gustar00rootroot0000000000000052 comment=a6b1d60e74c1427c8ac2324b85cd4a0dc2068332 libpqxx-6.4.5/000077500000000000000000000000001350065432700132225ustar00rootroot00000000000000libpqxx-6.4.5/.circleci/000077500000000000000000000000001350065432700150555ustar00rootroot00000000000000libpqxx-6.4.5/.circleci/config.yml000066400000000000000000000031341350065432700170460ustar00rootroot00000000000000# CircleCI config for automated test builds triggered from Github. version: 2 jobs: build: docker: - image: postgres:latest environment: - PGHOST: "/tmp" steps: - checkout - run: name: Install command: apt update && apt install -y python g++ libpq-dev postgresql build-essential make autoconf dh-autoreconf autoconf-archive automake cppcheck - run: name: Identify command: lsb_release -a && c++ --version - run: name: Prepare postgres command: | mkdir /tmp/db && chown postgres /tmp/db && su postgres -c '/usr/lib/postgresql/*/bin/initdb --pgdata /tmp/db --auth trust --nosync' - run: name: Run postgres command: (su postgres -c '/usr/lib/postgresql/*/bin/postgres -D /tmp/db -k /tmp' &) && sleep 5 - run: name: Create postgres user command: su postgres -c "createuser -w -d root" - run: name: Set up database command: createdb root - run: name: Autogen command: NOCONFIGURE=1 ./autogen.sh - run: name: Configure # TODO: Add --enable-audit once container has a recent compiler. command: | ./configure \ CXXFLAGS='-std=c++17' \ --disable-documentation \ --enable-maintainer-mode \ --enable-shared --disable-static - run: name: Make command: make - run: name: Test command: PGDATA=db/data make check libpqxx-6.4.5/.gitignore000066400000000000000000000012621350065432700152130ustar00rootroot00000000000000autom4te.cache ChangeLog confdefs.h config.log config.status config/compile conftest conftest.cpp conftest.err doc/_build doc/Doxyfile doc/html/Reference/*.css doc/html/Reference/*.html doc/html/Reference/*.js doc/html/Reference/*.png doc/html/Reference/*.map doc/html/Reference/*.md5 doc/html/Tutorial doc/reference-stamp doc/tutorial-stamp include/pqxx/config-*-*.h include/pqxx/config.h include/pqxx/stamp-h1 libpqxx.pc libpqxx-*.tar.gz libtool pqxx-config pqxxlo.txt test/pqxxlo.txt tools/pqxxthreadsafety tools/rmlo README win32/common **/Makefile **/*.la **/*.lo **/*.o **/.*.swp **/.deps **/.libs **/*~ **/lint.log **/lint.trs **/runner **/runner.log **/runner.trs **/test-suite.log libpqxx-6.4.5/AUTHORS000066400000000000000000000002211350065432700142650ustar00rootroot00000000000000Jeroen T. Vermeulen. Wrote the code. Ray Dassen. Did most of the autoconf etc. stuff. Lots of others helped with various other contributions. libpqxx-6.4.5/CMakeLists.txt000066400000000000000000000026061350065432700157660ustar00rootroot00000000000000cmake_minimum_required (VERSION 3.7) file(READ VERSION VER_FILE_CONTENT) string(STRIP ${VER_FILE_CONTENT} VER_FILE_CONTENT) project(libpqxx VERSION ${VER_FILE_CONTENT} LANGUAGES CXX) if(NOT "${CMAKE_CXX_STANDARD}") set(CMAKE_CXX_STANDARD 11) endif() set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) if(NOT SKIP_BUILD_TEST) option(BUILD_TEST "Build all test cases" ON) endif() include(GNUInstallDirs) include(CMakePackageConfigHelpers) include(config) add_subdirectory(src) add_subdirectory(include) if (BUILD_TEST) add_subdirectory(test) endif () # installation write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/libpqxx-config-version.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion ) install(FILES cmake/libpqxx-config.cmake "${CMAKE_CURRENT_BINARY_DIR}/libpqxx-config-version.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libpqxx ) install( EXPORT libpqxx-targets NAMESPACE libpqxx:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libpqxx ) # Build tree export export(EXPORT libpqxx-targets NAMESPACE libpqxx:: FILE ${CMAKE_CURRENT_BINARY_DIR}/libpqxx-targets.cmake ) configure_file( cmake/libpqxx-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/libpqxx-config.cmake COPYONLY ) # Package generation set(CPACK_GENERATOR TGZ) set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) include(CPack) libpqxx-6.4.5/COPYING000077500000000000000000000027261350065432700142670ustar00rootroot00000000000000Copyright (c) 2000-2019 Jeroen T. Vermeulen. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author, nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. libpqxx-6.4.5/INSTALL000077500000000000000000000213121350065432700142550ustar00rootroot00000000000000Basic Installation ================== The native build system for libpqxx is based on `configure` and `make`, but there is also a CMake build. Native build ------------ The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README.md' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. (Add e.g. `-j8` to run up to 8 simultanerous compiler processes to speed this up.) 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. CMake build ----------- With CMake you can generate a build setup in your choice of build system. The one I'm most familiar with is `make`. Like the native build, the CMake build needs the libpq library and headers installed. But in addition, it also needs the `pg_type.h` header installed. On some systems this will be in one of the `postgresql-server-dev-*` packages. That extra header is just to allow CMake to detect that you have a PostgreSQL development setup installed. The build shouldn't actually need the file otherwise, so if you can't find the file, it may be enough to create an empty file in the right place. The CMake build works like: 1. Go into the directory where you would like to build the library and its intermediate files. This may be the source directory. 2. Enter `cmake `, where `` is the location of the libpqxx source code. This generates the build configuration. 3. Type `make' to compile the package. (Add e.g. `-j8` to run up to 8 simultanerous compiler processes to speed this up.) Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment, or by adding them to the `configure` command line: ./configure CXX='clang++' CXXFLAGS=-O3 LIBS=-lposix Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README.md' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. libpqxx-6.4.5/Makefile.am000066400000000000000000000011471350065432700152610ustar00rootroot00000000000000SUBDIRS = include src test tools win32 config doc EXTRA_DIST = autogen.sh configitems README.md README-UPGRADE VERSION MAINTAINERCLEANFILES = \ Makefile.in aclocal.m4 config.h.in config.log configure stamp-h.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libpqxx.pc TESTS = tools/lint # Generate ChangeLog from git history. It goes all the way back through # the project's git, bzr, svn, and cvs days. dist-hook: ChangeLog ChangeLog: configure.ac git log --stat --name-only --date=short --abbrev-commit >$@ # We use README.md, but automake expects plain README. README: README.md ln -s $< $@ libpqxx-6.4.5/Makefile.in000066400000000000000000001206311350065432700152720ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = libpqxx.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope check recheck distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libpqxx.pc.in \ $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing \ $(top_srcdir)/config/mkinstalldirs \ $(top_srcdir)/config/test-driver AUTHORS COPYING ChangeLog \ INSTALL NEWS README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ SUBDIRS = include src test tools win32 config doc EXTRA_DIST = autogen.sh configitems README.md README-UPGRADE VERSION MAINTAINERCLEANFILES = \ Makefile.in aclocal.m4 config.h.in config.log configure stamp-h.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libpqxx.pc TESTS = tools/lint all: all-recursive .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): libpqxx.pc: $(top_builddir)/config.status $(srcdir)/libpqxx.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? tools/lint.log: tools/lint @p='tools/lint'; \ b='tools/lint'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-TESTS check-am clean clean-cscope \ clean-generic clean-libtool cscope cscopelist-am ctags \ ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-pkgconfigDATA .PRECIOUS: Makefile # Generate ChangeLog from git history. It goes all the way back through # the project's git, bzr, svn, and cvs days. dist-hook: ChangeLog ChangeLog: configure.ac git log --stat --name-only --date=short --abbrev-commit >$@ # We use README.md, but automake expects plain README. README: README.md ln -s $< $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/NEWS000066400000000000000000001050621350065432700137250ustar00rootroot000000000000006.4.5 - Fixed "const" support in arguments to parameterised/prepared statements. 6.4.4 - Use pkg-config if pg-config is not available. - In CMake build, prefer CMake's config headers over any found in source tree. 6.4.3 - Updated copyright strings. - Added missing "stream" headers to autotools-based install. - Added stream headers to pqxx/pqxx header. 6.4.2 - Fix mistake for Windows in 6.4.1: use PQfreemem, not std::free. - Easily enable runtime checks in configure: "--enable-audit". - Enable optimisation in CircleCI build. 6.4.1 - Fixed more memory leaks. 6.4.0 - Half fix, half work around nasty notice processor life time bug. - Fix selective running of tests: "test/unit/runner test_infinities". - Added some missing `std::` qualifications. 6.3.3 - Throw more appropriate error when unable to read client encoding. - CMake build fixes. 6.3.2 - Conversion errors no longer throw pqxx::failure; always conversion_error! - Use C++17's built-in numeric string conversions, if available. - Query numeric precision in a more sensible, standard way. - Avoid "dead code" warning. - Replace obsolete autoconf macros. - Remove all "using namespace std". - CMake build fixes. 6.3.1 - Windows compile fix (CALLBACK is a macro there). - Work around Visual Studio 2017 not supporting ISO 646. 6.3.0 - New "table stream" classes by Joseph Durel: stream_from/stream_to. - Support weird characters in more identifiers: cursors, notifcations, etc. - Connection policies are deprecated. It'll all be one class in 7.0! - Connection deactivation/reactivation is deprecated. - Some items that were documented as deprecated are now also declared as such. - Fix Windows bug where WSAPoll was never used. Thanks dpolunin. - Fix Windows CMake build to link to socket libraries. Thanks dpolunin. - Various other changes to the CMake build. - Fix failure when doing multiple string conversions with Visual C++. - Fix nested project builds in CMake. Thanks Andrew Brownsword. - In Visual Studio, build for host architecture, not "x64". - Fix string conversion link error in Visual Studio. Thanks Ivan Poiakov. - Fix string conversion to bool for "1". Thanks Amaracs. - Fix in escaping of strings in arrays. Thanks smirql. - Faster copying of results of large queries. Thanks Vsevolod Strukchinsky. - Starting to handle encodings properly! Thanks to Joseph Durel. - No longer using std::iterator (deprecated in C++17). 6.2.5 - Removed deprecated pqxx-config. - Build fix on Visual C++ when not defining NOMINMAX. - Reduce setup code for string conversions, hopefully improving speed. - Allow nul bytes in tablereader. - Support defining string conversions for enum types. - Fixed const/pure attributes warning in gcc 8. - Updated build documentation to mention CMake option. - Fixed a floating-point string conversion failure with Visual Studio 2017. 6.2.4 - Fix builds in paths containing non-ASCII characters. - New macro: PQXX_HIDE_EXP_OPTIONAL (to work around a client build error). 6.2.3 - Build fixes. 6.2.2 - Variable number of arguments to prepared or parameterised statement (#75). - Windows build fix (#76). 6.2.1 - Compile fixes. 6.2.0 - At last! A check against version mismatch between library and headers. - Small compile fixes. 6.1.1 - Small compile fixes. - A particular error string would always come out empty. 6.1.0 - Dependencies among headers have changed. You may need extra includes. - Library headers now include "*.hxx" directly, not the user-level headers. - Supports parsing of SQL arrays, when using "ASCII-like" encodings. 6.0.0 - C++11 is now required. Your compiler must have shared_ptr, noexcept, etc. - Removed configure.ac.in; we now use configure.ac directly. - Removed pqxx::items. Use the new C++11 initialiser syntax. - Removed maketemporary. We weren't using it. - Can now be built outside the source tree. - New, simpler, lambda-friendly transactor framework. - New, simpler, prepared statements and parameterised statements. - Result rows can be passed around independently. - New exec0(): perform query, expect zero rows of data. - New exec1(): perform query, expect (and return) a single row of data. - New exec_n(): perform query, expect exactly n rows of data. - No longer defines Visual Studio's NOMINMAX in headers. - Much faster configure script. - Most configuration items are gone. - Retired all existing capability flags. - Uses WSAPoll() on Windows. - Documentation on readthedocs.org, thanks Tim Sheerman-Chase. 5.1.0 - Releases after this will require C++11! - Internal simplification to pqxx::result. - A row object now keeps its result object alive. - New exec() variants: "expect & return 1 row," "expect no rows," "expect n." - ChangeLog is gone. It was a drag on maintenance. 5.0.1 - Exposed sqlstate in sql_error exception class. 5.0 - The PGSTD namespace alias is gone. Use the std namespace directly. - pqxx::tuple is now pqxx::row, to avoid clashes with std::tuple. - Deprecated escape_binary functions dropped. - Deprecated notify_listener class dropped. - Support for many old compilers dropped. - Support for "long long" and "long double" types is always enabled. - No longer uses obsolete std::tr1 namespace; use plain std instead. - Now requires libpq 9.1 or better. - Requires server version 9.1 or better. - Support for REPEATABLE READ isolation level added. - Makefile fixes for Visual Studio 2013. - Supports C++11 and C++14. - No longer has obsolete debian & RPM packaging built in. - Fixed failure to abort uncommitted subtransactions on destruction. - Fixed failure to detect some integer overflows during conversion. - Build tooling uses /usr/bin/env python instead of /usr/bin/python. - New configure options: --with-postgres-include and --with-postgres-lib. - In g++ or compatible compilers, non-exported items are no longer accessible. - Many build fixes for various platforms and compilers. 4.0 - API change: noticers are gone! Use errorhandlers to capture error output. - API change: tablereaders and tablewriters are gone; they weren't safe. - API change: prepared statements are now weakly-typed, and much simpler. - API change: fields and tuples are now stand-alone classes in ::pqxx. - API change: thread-safety field have_strerror_r is now have_safe_strerror. - API change: notify_listener has been replaced with notification_receiver. - notification_receiver takes a payload parameter. - Easier Visual C++ setup. - Absolutely requires a libpq version with PQescapeStringConn. - Absolutely requires libpq 8.0 or better. - Changes for C++0x. - Supports clang++. - Visual C++ makefiles now support new-style unit tests. - Sample headers for more recent Visual Studio versions. - Fixes binary-data escaping problems with postgres 9.0. - Fixes problems with binary-string handling and escaping. - Fixes compatibility problems between 9.x libpq and 7.x backend. - quote_name to escape SQL identifiers for use in queries. - syntax_error reports error's approximate location in the query. - On Windows, now uses ws2_32 instead of wsock32. - Various Windows build fixes. - Updated for gcc 4.6.0. - configure script supports --enable-documentation/--disable-documentation. - Streamlined test/release toolchain. 3.1 - Shared libraries are now versioned by ABI: 3.1 instead of 3.1.0 etc. - Threading behaviour is now documented, and can be queried. - Version information available at compile time. - Supports parameterized statements. - Result tuples now support slicing. - Configure with --with-tr1=boost to use BOOST shared_ptr. - String conversion now has its own header file. - Supports read-only transactions. - Fixed breakage with Solaris "make". - Uses shared_ptr if available. - binarystring::str() is no longer cached; no longer returns reference. - Fixed problems in Visual C++ Makefile for test suite. - Fixed problems with RPM packaging. - Fixed build problem on RedHat/CentOS 5. - Lets you check whether a prepared statement has been defined. - "Varargs" prepared statements. - Unnamed prepared statements now supported. - Results have iterator as well as const_iterator. - Rewrite of robusttransaction logic; may actually do its job now. - Connections support async query cancel from signal handler or thread. - More documentation for performance features. 3.0 - Website is now at http://pqxx.org/ (no redirects) - Completely replaced cursor classes - More helpful error messages on failed connections - More detailed hierarchy of constraint-violation exception classes - trigger is now called notify_listener, trigger header is now notify-listen - New mixin base class pqxx_exception distinguishes libpqxx exception types - Quoting is back! transaction_base::quote() & connection_base::quote() - Several build & documentation problems with Visual C++ fixed - Compile fixes for gcc 4.2, 4.3 - Compile fixes for Sun Studio Express 5.9 - Uses strlcpy() where available, instead of strncpy() - Keeps better track of applicable text encodings - Fixed bug with prepared statement parameters in separate C++ statements - robusttransaction now works for multiple users - Pipeline lets you cancel ongoing queries, e.g. because they run for too long - Fixed broken escaping of binary values in tablewriter - Floating-point types now represented with full precision - Proper unit tests for new functionality - New traits-based system for adding data types - Floating-point infinities now supported - Flushing/completing a pipeline now frees up the transaction for other use - Completely reworked test suite, builds and runs much faster - tablewriter supports writing of raw lines 2.6.9 - Removed old 1.x API (that means all identifiers with capital letters!) - Tested with all current libpq versions and oldest/newest supported backends - No longer have old OnCommit()/OnAbort()/OnDoubt() callbacks in transactor! - Fixes failure when closing cursors with upper-case letters in their names - Fixes bug when adding triggers to connections that aren't open yet - Fixes bug when removing triggers - Fixes small memory leak when preparing statements - Fixes many problems with older backends - Fixes bug in result::swap(): protocol versions were not swapped - Some errors went undetected when using certain libpq versions - Fixes prepared statements on new libpq versions talking to old backends - Can estimate server version if libpq does not know how to obtain it - Greatly reduced memory usage while escaping strings - With Visual C++, creates lib/ directory if not already present - Useful error messages when preparing statements - Allows prepared statements to be registered explicitly - Support for "long long" types; enable with PQXX_ALLOW_LONG_LONG macro - Compilation errors for older libpq versions fixed - Some new small utility classes for disabling notice processing etc. - Result sets remember the queries that yielded them - New test script, pqxx-fulltest, tests against all current postgres versions - Connections can simulate failure - Adds password encryption function 2.6.8 - Fixes bug: binary parameters to prepared statements truncated at nul bytes - New, more specific exception types to distinguish errors from server - Resolved serious problems with generated reference documentation - Automatically detect Windows socket library with MinGW - Windows "make" fixed to run from main directory, not win32 - Fixes "mktemp" problems on some BSD-based platforms - pqxx-config is deprecated; use pkg-config instead - On GNU/Linux, uses poll() instead of select() to avoid file descriptor limit - Will provide server and protocol version information where available - New cursor class, absolute_cursor 2.6.7 - New escape functions for binary data: transaction_base::esc_raw() - Improved detection of socket libraries, especially for MinGW - Works around bug in some versions of GNU grep 2.5.1 - Fixes problem with configuration headers - Fixes PQprepare() detection - Fixes incomplete Visual C++ Makefile - Fixes compile error in workaround for older libpq versions - Removes "rpath" link option 2.6.6 - New, encoding-safe string-escaping functions - Upper-case letters now allowed in prepared-statement names - Fixes crash in test005 - More Visual C++ improvements - Removed collaboration diagrams from reference docs - New templating system for generating Windows Makefiles etc. 2.6.5 - Visual C++ users: copy win32/common-sample to win32/common before editing it - Should fix problems finding socket library on MinGW - Even more work on Visual C++ problems - Updated documentation for Visual C++ users - Fixed bug in prepared statements (mostly visible on Visual C++) - Nested transactions work harder to detect backend support 2.6.4 - Massively improved compatibility with Windows and Visual C++ - Fixed late initialization of "direct" connection state - Fixed problem with initialization of connection capabilities - Fixed configuration bug for libpq in nonstandard locations - Sample configuration header for libpq found in PostgreSQL 8.1 2.6.3 - Radical rework of prepared statements; INCOMPATIBLE INTERFACE CHANGE! - Dropped support for g++ 2.95 - Emulate prepared statements support on old libpq or old backend - Bug fix: missing tutorial (release script now tests for this) - Automatically links in socket library on Windows or Solaris, if needed - Bug fix: check for std namespace didn't work - Fixes for Cygwin/MSYS/MinGW 2.6.2 - Bug fix: connection state was not set up properly in some common cases - Bug fix: headers were installed in "include" instead of "include/pqxx" - Bug fix: sqlesc(string) broke with multibyte or multiple encodings - namedclass is now used as a virtual base; affects all subclass constructors - Initial implementation of subtransactions - Detect more connection capabilities - Standard library namespace can be set from configure script's command line - Completely reworked connection hierarchy, with separate policy objects - Clients can now define their own connection policies - Paved the way for client-defined thread synchronization - Now lives at http://thaiopensource.org/development/libpqxx/ 2.6.1 - Hugely improved recognition of different strerror_r() versions - Resolved link problems with gcc 4.0 and shared library 2.6.0 - New macro PQXX_SHARED defines whether to use/build libpqxx as shared library - Robusttransaction compatible with PostgreSQL 8.1 - Infrastructure for querying connection/backend capabilities at runtime - Greatly improved cursor support - Connection reactivation can be inhibited explicitly - Tries even harder to make sense of conflicting strerror_r() definitions - Detects connection failures that libpq glosses over - Reference documentation grouped into more coherent sections - Assumes strerror() is threadsafe on systems that have no strerror_r() - Now allows connection's socket number to be queried - New internal_error class for libpqxx-internal errors - With Visual C++, doesn't redefine NOMINMAX if it is defined already - Several compatibility improvements for Visual C++ - Fixes and workarounds for HP-UX and HP aCC compiler - Phased old cursor interface out of test suite; tests ported to new interface - Added documentation on thread safety - New thread safety model - Large objects have functions to tell current position - Minor updates to tutorial (somebody pay me and I'll do more :) - No longer needs libpq-fs.h header - Meaningful error messages for ambiguous string conversions fixed 2.5.6 - Support null parameters to prepared statements (use C-style char pointers) 2.5.5 - Diagnoses connection failure during result transfer - Fixes invalid -R link option in pqxx-config 2.5.4 - Fix workaround code for older libpq versions without PQunescapeBytea() - Work around grep bug in Fedora Core 4 that broke configure in UTF-8 locales - In Visual C++, assume libpqxx is a DLL when linking to std library as DLL - Missing documentation in distribution archive is back again - Export fewer symbols from library binary with gcc 4.0 - Releases now automatically tested against gcc 4.0 - Meaningful link errors for additional ambiguous string conversions - DLL symbol exports now automatically tested before each release 2.5.3 - Greatly improved builds on MinGW with MSYS - All known problems with MinGW fixed - Fix bugs in stream classes that caused failures and crashes with STLport - Detects and uses STLport automatically 2.5.2 - Fix memory leaks - Fix problems with NaN (not-a-number values) on some compilers 2.5.1 - Fix configure script; broke when very recent libpqxx was already installed - Fix cursor breakage when "long" is more than 32 bits - Fix cases where new-style abort/doubt handlers are used - Fix for division-by-zero error in Visual C++ (changed sample headers) - Improved checking for strerror_r in configure script - Fix for problem MinGW has with configure script - Fix spurious failure of Oid check in configure script 2.5.0 - Fix race condition in removing triggers - Fix binary string conversion with older libpq - Fix some error strings that may previously have come out wrong - No longer includes any libpq headers while compiling client code - Improved thread safety: avoid strerror() where possible - Prepared statements - Translate more error conditions to std::bad_alloc exception - Clearer and more specific explanations for configuration failures - Improved documentation - Looks for standard library in global namespace as well as std - Accepts standard C library in std namespace - Release script automatically tests with a range of compilers, not just one - Compatible with g++ 2.95 again; this time it's tested automatically 2.4.4 - Fix problems building shared library in Visual C++ - Fix autobuild in Debian, which was broken by mistake in BSD grep workaround - Fix conversion of string to floating-point type NaN - Remove stray CVS directories from distribution archive - Workaround for Visual C++ problem when issuing messages from destructors - Yet more workarounds for Visual C++ bugs - Fix situation where connection state might not be restored after failure - Fix configuration problem on SunOS - Network speedup in connection setup with pending variables and/or triggers 2.4.3 - Yet more workarounds for bugs in Visual C++ .NET 2003 - Fixes for SunC++ 5.5 - On Visual C++, now defines NOMINMAX, fixing large object support - Workaround for BSD grep - Improvements for builds from CVS - Sample config headers for Sun ONE Studio 8 2.4.2 - Fix minor problems with Apple's version of g++ 3.3 - Fix problem with MingW on Windows - Workarounds and fixes for Visual C++.NET 2003 - Renewed compatibility with g++ 2.95 - More sample configuration headers - Updated reference documentation - Removed assert code 2.4.1 - Several bugs in icursor_iterator fixed; incompatible interface changes - Tightens throw specifications on begin(), end(), size(), capacity() - Containers define reference and pointer types - Implements swap() in all container types - Implements == and != in all container types - Stabilizes new (but still limited) cursor interface - icursor_iterator thinks purely in stride granularity - Introduces />= comparisons for icursor_iterators - Allows "adopted SQL cursors" in new cursor interface - Reference-counting in binarystrings, so they can be copied (and efficiently) - Fixes reference-to-temporary problem with std::reverse_iterator in results - Result/tuple reverse_iterators no longer require std::reverse_iterator - Includes some sample config headers (in config/sample-headers) - Replaces iffy autoconf checks (avoid failures with maintainer mode's -Werror) - Fixes incompatibility with some implementations of Unix "cut" program (again) 2.4.0 - Fixes incompatibility with some implementations of Unix "cut" program - Fixes "ptrdiff_t redefinition" problem in some environments - More container-like tuples, so fields can be iterated - All size_type types are now unsigned - More conservative robusttransaction--thanks Tom Lane - Stream-like extraction operator for result field conversion - Warnings about deprecated headers now suppressed while compiling library - Iterator constructors and copy assignments now have empty throw specs 2.3.0 - Generates MinGW Makefile automatically - Documents MinGW build - Workaround for missing prepared-statement support - Potential bug fixed in closing of connections - Fixed incompatibility between new cursor streams and older backends - Removed pqxxbench 2.2.9 - Bugfix in removing trigger - Added "failed connection" to regression test - Some changes to throw specifications - Putting libpq in its own namespace is optional 2.2.8 - Moved libpq into pqxx::internal::pq namespace - New config system separates compiler-related items from libpq-related ones - Auto-generates Visual C++ Makefile, should always remain up-to-date now 2.2.7 - Bugfix: from_string() didn't handle LONG_MIN--thanks Yannick Boivin 2.2.6 - Complete "pipeline" rewrite, for better exception safety - New garbage collection scheme for "result;" constructors now exception-free 2.2.5 - First new cursor classes! - Fixed strange failure in tablewriter during large insertions - Updated tutorial 2.2.4 - New utility class template, items<> for easy container initialization - New utility function template, separated_list() - Error handling bugfix in tablewriter - Fixed tablereader handling of lines ending in empty fields - tablereader lines no longer end in newline with old libpq versions 2.2.3 - Trigger names no longer need to be proper identifiers - Compile fixes for g++ 3.4.0 and other modern compilers - Tablestreams may specify column lists - Deprecated Quote() in favour of sqlesc(); improved quoting - Fixed generation of libpqxx.spec 2.2.2 - Bugfix in fieldstream w.r.t. reading strings on some systems - Renamed config.h to internalconfig.h to avoid confusion - New connection functions allow client to sleep until notification arrives - Notification functions return number of notifications received - Even fewer client-visible macros exported by libconfig.h 2.2.1 - New, 2.x-style string conversions without locale problem - Documentation improvements - Implemented result::swap() 2.2.0 - Installs to /usr/local by default, NOT to /usr/local/pqxx like before! - Uses Postgres-provided script to find Postgres (thanks Peter Eisentraut) - Which means no more configure arguments required on Irix (thanks Arjen Baart) - Fixes long-standing bug in result class! - New pipeline class for throughput optimization - New field stream class: read result field as C++ stream - Separate namespace pqxx::internal for definitions not relevant to the user - More Windows compilation fixes - SUN Workshop 6 compile fixes and workarounds (thanks Jon Meinecke) - Implemented reverse_iterator for result class - Checks for functional std::reverse_iterator template - Preliminary Makefile for MinGW compiler (thanks Pasquale Fersini) - Changed the way unique<> works - Checks for functional std::count_if() - Bugs fixed & test programs added 2.1.3 - Makefile fixes for Visual C++, thanks Paresh Patel - Library ABI versioning implemented, thanks Roger Leigh - Uses old SQL isolation level syntax for compatibility, thanks koun@sina.com - tablestreams can explicitly complete() before destructor - Bugfix in robusttransaction: forgot to set isolation level - Fixed off-by-ones in tablewriter escape code - tablestreams now use \n-style escape sequences - tablestreams support octal numbers - Freely definable "null" strings in tablestreams, as originally intended - Improved Debian packaging, thanks Roger Leigh - tablestreams use libpq's new-style COPY functions, if available - Extended automation of build/release procedure - tablewriter writes in nonblocking mode to help hide communication latency - Can get backend variables as well as set them - More configuration macro cleanups - Workaround for missing clear() in standard string - Merry Christmas! 2.1.2 - Compile fix for gcc libstdc++ 2.9, thanks Jaroslaw Staniek - Moved deprecated functions below current ones - Cleanups for Debian packaging (thanks Roger Leigh, new Debian maintainer!) - Updated authors listings - Bumped ABI version number for the first time (now 2:0:1) 2.1.1 - More workarounds for gcc 2.95 - Automated tools keep test makefiles up to date 2.1.0 - Asynchronous connections - Fixed configure --includedir option (thanks Ray Dassen!) - Compile fixes for SUN Workshop 6, and one for gcc on FreeBSD 4.8 2.0.0 - New stable release! - Includes all changes since 1.5 release. - Workarounds for Microsoft Visual C++ 7 problems. Thanks Costin Musteata! - No longer need to define PQXX_NO_PARTIAL_CLASS_TEMPLATE_SPECIALISATION - Integrated Windows configuration into regular configuration - Only uses #warning if preprocessor supports it - Works on libpq versions without PQ[un]escapeBytea() 1.9.9 - Minor documentation changes 1.9.8 - Workaround for compile problem with postgres 7.3 - Convenience typedef for transaction<>: "work" 1.9.7 - binarystring rewritten and moved to its own file - binarystring::size() does not include terminating null byte! - Implemented escaping of binary strings - Fix in workaround for missing numeric_limits on some compilers - String conversion supported for unsigned char * - More helpful link errors for unsupported string conversions - Complete test coverage 1.9.6 - Fixes in "field table" support - Improved coexistence with client program's config.h, if any - Prefixed autoconf macros used in headers with "PQXX_" 1.9.5 - Header file contents moved to .hxx files for editor filetype recognition - Fixes wrong timestamp for include/pqxx/result in 1.9.4 distribution 1.9.4 - Fixes Visual C++ build problem when compiling as library 1.9.3 - Quick release for various minor changes 1.9.2 - Renamed most public member functions to all-lower-case names - (previously is now called 1.9.1 - tablestream destructor crashed if table didn't exist (thanks Sean [Rogers?]) - Renamed all header files to remove ".h" suffix - Tables created by regression test now prefixed with "pqxx" for safety - Large objects now considered stable - Migrated tutorial from SGML to DocBook XML (thanks Wichert Akkerman) - Added tests 57-59 - Fixed compile error in largeobject - Updated Windows makefiles 1.9.0 - EVERYTHING HAS CHANGED. Read the list or run into trouble! - CURSOR HAS INCOMPATIBLE CHANGES AND MAY BE REPLACED COMPLETELY - CACHEDRESULT HAS INCOMPATIBLE CHANGES (won't compile without changes) - REVISE YOUR TRANSACTORS; now templatized on transaction type - Finally got license file in order - Incompatible change in setting transactor quality of service - Cursors require serializable isolation level (checked at link time) - Renamed Connection_base to connection_base, Connection to connection, LazyConnection to lazyconnection - Renamed LargeObject to largeobject, LargeObjectAccess to largeobjectaccess - Renamed Noticer to noticer - Renamed Trigger to trigger - Renamed Result to result, Tuple to tuple, Field to field - Renamed Unique<> to unique<> - Renamed CachedResult to cachedresult - Transformed Transaction Taxonomy (TTT): - Renamed Transaction_base to transaction_base - Renamed Transaction to transaction - Renamed Transactor to transactor<> (now a template) - Implemented transaction isolation levels as compile-time static properties - transaction and robusttransaction now templatized on their isolation levels - cachedresult requires serializable isolation level (checked at link time) - Now need to include pqxx/transactor.h yourself if you need transactors - Large objects require real backend transaction at compile time - New type oid and constant oid_none for row identifiers resp. null oid - Added some forgotten PQXX_LIBEXPORTs - Tweaked documentation in many places 1.8.1 - By popular request: more convenient way to read field values - Documented locale sensitivity of ToString(), FromString(), Field::to() 1.8.0 - Compiles on gcc 2.95 again (heavy streambuf workarounds in largeobject.h) - ConnectionItf renamed to Connection_base, TransactionItf to Transaction_base - connectionitf.h is now connection_base.h, transactionitf.h connection_base.h 1.7.8 - BinaryString class for unescaping bytea strings - PQAlloc template keeps track of libpq-allocated objects - Removed some consts in Unique<>, ConnectionItf, sorry! - Can now set session variables on connections, transactions 1.7.7 - ./configure also looks for postgres in /usr/local/pgsql - test007 now uses SQL_ASCII as its test encoding - integrated Greg Hookey's Debian packaging 1.7.6 - added postgres library (libpq) to dynamic link path 1.7.5 - added test052 - test055 - added Result::Tuple::ColumnNumber() - also test setting of client encodings - removed superfluous versions of to_file() from large object classes 1.7.4 - new exception class, sql_error, remembers query text - moved exception classes to new file include/pqxx/except.h - test cases report texts of any failed queries - added tools/rmlo.cxx 1.7.3 - default constructors for connection classes - revamped seeking operations on large objects - better error messages in large objects - added test050, test051 1.7.2 - more workarounds for Sun CC 5.1, thanks Jeroen van Erp! - preliminary support for "named" queries - can now Quote() string constants - included Doxyfile in distribution archive - helps avoid Windows memory allocation problem in DLLs - allows setting of client character set encoding 1.7.1 - regenerated documentation 1.7.0 - removed all deprecated features - connection string documentation in README - separate Connection, LazyConnection classes - made test001 more concise - added test049 1.6.4 - configure script now respects different std namespace 1.6.3 - olostream, lostream now flush themselves before closing - fixed compilation problems when using ToString<>() on a plain char * - compilation fixes for Sun compiler (thanks Jeroen van Erp!) - added .pc file for pkgconfig (thanks Ray Dassen!) 1.6.2 - Debian packaging added to distribution archive - new ilostream, olostream, lostream classes 1.6.1 - large object's cunlink() replaced by remove() - default constructor for LargeObject 1.6.0 - new large objects interface - added test048 1.5.0 - allow result fields to be written to streams - removed confusing CachedResult::clear() - minor documentation updates - added test046, test047 - added convenience header 1.4.5 - fixed crash CachedResult that was less shallow than I thought - fixed quoting problem with adopted SQL cursors 1.4.4 - (forgot to save cursor.cxx with new constructor in 1.4.4, sorry) 1.4.3 - all tests now have three-digit numbers - Cursor can adopt SQL cursor returned by a function 1.4.2 - bugfix in CachedResult when accessing empty Results - minor documentation improvements 1.4.1 - documents new homepage: http://pqxx.tk/ - Connection constructor accepts null connect string - Exec() now also takes queries as C++ strings 1.4.0 - Connection::IsOpen() renamed to is_open() - NoticeProcessor replaced by Noticer (with C++ linkage) 1.3.7: - detects nasty rare problem case with Cursors in unknown positions 1.3.6: - fixed detection of missing PQescapeString(). Thanks David Wright! v1.3.5: - documented Windows build procedure - fixed problem with upper-case letters in cursor names. Thanks key88! 2003-01-19 16:00, v1.3.4: - support long double type - clarified some error messages 2003-01-08 18:45, v1.3.3: - fix missing include in test13 2003-01-07 02:30, v1.3.2: - configure looks for postgres includes/library in more places, thanks Ray! 2003-01-02 23:00, v1.3.1: - bugfix in Cursor positioning 2003-01-02 20:30, v1.3.0: - absolute positioning for Cursor - better documentation on cursors - reduced, but improved test suite output 2002-12-23 17:30, v1.2.8: - Cursor::Move() returns number of rows skipped - new typedef Cursor::size_type 2002-12-14 23:30, v1.2.7: - test suite now distinguishes expected errors from unexpected ones 2002-12-09 20:00, v1.2.6: - fixed some Cursor test cases for change in postgres 7.3 - added important warning to Cursor 2002-12-09 02:00, v1.2.5: - added important warning to CachedResult 2002-12-08 14:14, v1.2.4: - fixed compile error on some systems in include/pqxx/util.h 2002-12-04 12:00, v1.2.3: - workaround for broken on some systems - fixed Quote() bug 2002-12-03 01:30, v1.2.2: - fixed serious CachedResult bug - added test41 2002-12-02 17:00, v1.2.1: - hopefully fixed cursor bug with PostgreSQL 7.3 2002-12-01 22:00, v1.2.0: - new CachedResult class 2002-11-07 13:15, v1.1.4: - workaround for missing InvalidOid definition 2002-10-23 16:00, v1.1.3: - Cursor & TableStream hierarchy now work on any transaction type - get no. of affected rows & oid of inserted row from Result - increased test coverage 2002-10-21 01:30, v1.1.2: - updated build procedure - Debian packaging improvements 2002-09-25 03:00, v1.1.1: - supports activating/deactivating of connections - various Connection getters now activate deferred connection first 2002-09-23 01:00, v1.1.0: - supports lazy connections (added 19 test cases just for these) - greatly reduced performance overhead for RobustTransaction - removed id field from RobustTransaction's transaction log tables 2002-09-14 20:00, v1.0.1: - now lives on GBorg - various packaging updates 2002-06-12 17:30, v0.5.1: - no longer have to destroy one transaction before creating the next 2002-06-07 17:15, v0.5.0: - "make install" now finally installs headers! - distribution now includes SGML (DocBook) version of tutorial 2002-06-04 15:00, v0.4.4: - may now have multiple triggers with same name on single connection 2002-06-02 23:00, v0.4.3: - fixed TableReader problem with \t and \n 2002-06-01 21:00, v0.4.2: - hopefully fixes compile problem with broken std::iterator - configure no longer requires --with-postgres-include=/usr/include/postgresql 2002-05-29 22:00, v0.4.1: - can now also handle bool, unsigned char, short field types 2002-05-27 22:30, v0.4.0: - RENAMED Transactor::TRANSACTIONTYPE to argument_type for STL conformance - RENAMED Result::Field::name() to Name() - documentation improvements - minor optimizations 2002-05-18 00:00, v0.3.1: - removed broken postgres_fe.h dependency (hopefully permanent fix) 2002-05-12 22:45, v0.3.0: - also looks for postgres_fe.h in postgres' internal/ directory (tmp fix) 2002-05-05 01:30, v0.2.3: - extensive build instructions in README - make check now controlled through PG environment variables 2002-05-04 19:30, v0.2.2: - more STL conformance - fixed regression test - test6 now copies "orgevents" to "events" by default 2002-04-28 23:45 Version bumped to 0.2 2002-04-28 23:45 Self-generated distribution archive 2002-04-27 14:20 Replaced automake symlinks with actual files 2002-04-07 02:30 Released with configure script 2002-03-29 01:15 Not yet released. Still integrating autogen stuff... libpqxx-6.4.5/README-UPGRADE000066400000000000000000000011021350065432700151610ustar00rootroot00000000000000NOTICES FOR USERS UPGRADING FROM EARLIER VERSIONS TO 6.x As of 6.0, libpqxx requires C++11 or better. Make sure that your libpqxx is built against the same version of the C++ standard as your own application, or there may be build problems. It may be possible to paper over some mismatches. If your application build fails with errors about `std::experimental::optional`, try defining a macro `PQXX_HIDE_EXP_OPTIONAL` in your application's build. This will suppress support for `std::experimental::optional` even if libpqxx was built to assume that the feature is present. libpqxx-6.4.5/README.md000066400000000000000000000453521350065432700145120ustar00rootroot00000000000000libpqxx ======= Welcome to libpqxx, the C++ API to the PostgreSQL database management system. Compiling this package requires PostgreSQL to be installed -- including the C headers for client development. The library builds on top of PostgreSQL's standard C API, libpq, though this fact is almost completely hidden from programmes which use libpqxx. As of release 6.0, C++11 is the minimum supported C++ version. Make sure your compiler supports this, and if necessary, that you have support for C++11 configured. **Version 7.0 will require C++17.** However, it's probably not a problem if your compiler does not implement C++17 fully. Initially the 7.x series will only require some basic C++17 features such as `std::string_view`. More advanced use may follow later. Also, **7.0 will make some breaking changes in rarely used APIs:** * All `connection` classes will be folded into a single class. * Custom `connection` classes will no longer be supported. * Connection reactivation will be explicit: _you_ call `activate()` if needed. * "String traits" (for string conversions) will have a slightly different API. Find libpqxx on Github: https://github.com/jtv/libpqxx Building libpqxx ---------------- There are three very different ways of building libpqxx: 1. Using CMake, on any system which supports it. 2. On Unix-like systems, using a `configure` script. 3. With Visual Studio on Windows, using supplied project files and headers. The CMake build should work on any system where CMake is supported. This is a recently contributed alternative build, so if you run into problems, your help could be crucial in fixing them. The "Unix-like" section applies to systems that look like Unix: GNU/Linux, Apple OSX and the BSD family, AIX, HP-UX, Irix, Solaris, etc. Microsoft Windows with a Unix-like environment such as Cygwin or MinGW installed should also work in the same way. There is a separate section below for a Visual C++ build on Windows. It takes a bit of work, and if the CMake build works well, we may drop support for the Windows/Visual C++ build later. ### Using CMake On CMake the standard way of working is to have the source tree in one directory, and build in another. (The `configure` script supports this as well, but that build is enough work that I didn't bother documenting it.) Let's say you have the libpqxx source tree in a location `$SOURCE`, and are building in a different location `$BUILD`. CMake also lets you choose whether to run the ultimate build through `make`, or some other tool. The default on Unix-like systems is `make`, but you may have to look in the CMake documentation what works well on your system. For a default build, using those two directories, go into `$BUILD` and run: ```shell cmake $SOURCE ``` This sets up the build, in your current directory. Stay in the `$SOURCE` directory, and run: ```shell make ``` If you have multiple cores that you want to put to good use, use the `-j` option to make it run multiple jobs in parallel. For instance, if you have 8 CPU cores, you'll probably want to be compiling about 8 files simultaneously: ```shell make -j8 ``` ### On Unix-like systems For the Unix-like systems the procedure is the standard "configure, make, make install" sequence. In order to run the test suite, you'll also need to set up a database for the tests to play with. Run the "configure" script with the `--help` option to see build and installation options. You need to get these right before you compile. Then: ```shell ./configure # (plus any options you find appropriate) make ``` This will compile the library. You'll also want to run the test suite to make sure that everything works. To prepare for that, you need to set up a disposable test database that the test suite to play with. You'll want password-less authentication so that you won't need to log in for every test. In this example, the test database is called pqxx-test and runs on a server at IP address 192.168.1.99. Before running the test, make sure you can log into your test database with psql, the command-line SQL shell that comes with PostgreSQL: ```shell PGHOST=192.168.1.99 PGDATฺABASE=pqxx-test psql ``` Once you have that working, use the same login parameters to run the libpqxx test suite: ```shell make PGHOST=192.168.1.99 PGDATABASE=pqxx-test check ``` Assuming that the test suite runs successfully, you are now ready to install. You'll typically need superuser privileges to run this command: ```shell make install ``` Now you should be able to link your own programs with libpqxx. If something went wrong along the way, or what you have isn't quite what you wanted, it's time to move on to that fineprint that we hinted at earlier. #### 1. Configure A word on the configure script. It needs to find the C header and the binary for libpq, the C-level client library, so that the libpqxx build procedure can make use of them. The configure script finds these files by running a script called pg\_config that comes with PostgresQL. If you have postgres installed, pg\_config should be somewhere on your system. It will "know" where the relevant files are. The configure script just needs to run it. Make sure that the folder containing pg\_config is in your executable path before you run the configure script, or it will fail with a message like: ``` configure: error: PostgreSQL configuration script pg_config was not found. ``` If you don't want to have pg\_config in your path for whatever reason, or you have multiple PostgreSQL installations on your system (each with their own copy of pg\_config) and wish to override the default version, add an option like this to your "configure" command line: ```shell PG_CONFIG=/home/me/postgres/bin/pg_config ``` Here, "/home/me/postgres/bin/pg\_config" is just an example of where your preferred copy of pg\_config might be. This would tell the configure script that you wish to build a libpqxx based on the postgres version found in /home/me/postgres. About installing: if you wish to install libpqxx in a custom location, such as your home directory /home/me, you can specify this to the configure script before you build libpqxx. You select the installation location using the configure script's --prefix option, e.g.: ```shell ./configure --prefix=/home/me ``` A custom location can be useful to keep locally-build software separate from packaged software. Conventional installation locations for custom software on Unix-like systems are /usr/local and /opt. Custom installation locations can also be handy if you don't have administrator rights on the machine you're working on! The configure scripts supports many other options to tweak how and where libpqxx is to be built and installed; try the --help option to get an overview if you're interested. If configuration just plain won't work for whatever reason: take a look in the config/sample-headers/ directory. Here you will find configuration headers for various compilers and libpq versions. Pick the config-internal-\*.h and config-public-\*.h headers for the compiler and libpq version most closely matching your own, and see if they work for you. You may also want to tweak them manually. #### 2. Make One problem some people have run into at this stage is that the header files for PostgreSQL need the OpenSSL header files to be installed. If this happens to you, make sure openssl is installed and its headers are in your compiler's include path. #### 3. Make Check "Make check" is where you compile and run the test suite that verifies the library's functionality. The "make check" procedure needs a database to play with. It will create and drop various tables in that database. Use a throwaway database for this or risk losing data! (Actually the test only manipulates tables whose names start with "pqxx" so in practice the risk will be small. But better safe than sorry: use a disposable test database separate from your own data.) To direct the test suite to the right database, set some or all of the following environment variables as needed for "make check": ``` PGDATABASE (name of database; defaults to your user name) PGHOST (database server; defaults to local machine) PGPORT (TCP port to connect to; default is 5432) PGUSER (your PostgreSQL user ID; defaults to your login name) PGPASSWORD (your PostgreSQL password, if needed) ``` Further environment variables that may be of use to you are documented in the libpq documentation and in the manpage for Postgres' command-line client, psql. Setting environment variables works differently depending on your shell, but try one of these: ```shell VARIABLE=value export VARIABLE ``` or ```shell set VARIABLE=value ``` Try printing the variable afterwards to make sure. The command is normally ```shell echo $VARIABLE ``` If you set the variable successfully, it should print the value you assigned. It will print nothing if you failed to set the variable. On Unix-like systems, postgres may be listening on a Unix domain socket instead of a TCP port. The socket will appear as a file somewhere in the filesystem with a name like .s.PGSQL.5432. To connect to this type of socket, set PGHOST to the directory where you find this file, as an absolute path. For example, it may be "/tmp" or "/var/run" or "/var/run/postgresql". The leading slash tells libpq that this is not a network address but a local Unix socket. #### 4. Make Install This is where you install the libpqxx library and header files to your system. Assuming this succeeds, you should now be able to build your own programs by adding the location of the header files (e.g. /usr/local/pqxx/include) to your compiler's include path when compiling your application. Similarly, add the location of the library binary (e.g. /usr/local/pqxx/lib) to your library search path when linking your application. See the documentation and the test programs for more information on using libpqxx. If you link with the dynamic version of the library, you may find that your program fails to run because the run-time loader cannot find the library. There are several ways around that. Pick the first option that works for you: 1. by linking to the static version of the library, or 2. adding a link to the dynamic libpqxx library somewhere in your system's standard library locations, or 3. adding libpqxx's lib/ directory to your loader's search path before running your program. On Unix-like systems including GNU/Linux, the loader's search path can be extended by setting the LD\_LIBRARY\_PATH variable. Enjoy! ### On Microsoft Windows Project files for Visual C++ are provided in the win32 directory, along with some other Windows-specific material. These are very old, so if you run into problems, please let us know what we can do to fix them. One known problem is that _folder names with spaces in them_ cause trouble. If you run into trouble, try using the alternative build using CMake! As yet another alternative, if you are running a Unix-like environment such as Cygwin, you may want to try if the Unix build procedure works for you. In theory it should be possible to run the configure script and build with Visual C++ or any other compiler, so long as you have a reasonably Unix-like shell environment. If you do proceed with the Visual C++ files, you'll need to copy the most appropriate compile-time configuration files from various subdirectories in config/example-headers/ to include/pqxx. You'll want to tweak them manually to define the exact features your system, compiler, and PostgreSQL versions support. On a Unix-like system the configure script would do this for you. Before trying to compile with Visual C++, you'll at least need to copy the file win32/common-sample to win32/common, and edit the latter to reflect the proper paths to your PostgreSQL headers and the libpq library. See the win32 subdirectory for more documentation. #### Manual Configuration: config-\*-\*.h Normally, on any vaguely Unix-like system, the configuration headers (called config-internal-\*.h for the library's internal use, config-public-\*.h for both the library and client programs) are generated from config.h.in. All these files, once generated, are situated in the include/pqxx/ directory. The configitems file lists all configuration items and where they go; but see win32/INSTALL.txt for a detailed description of how these files work. Getting the compiler-related configuration right can take several stages of trying to build, looking at error messages, looking for configuration items that may be related, changing them, and building again. If nothing seems to help, register an issue on Github. Be sure to read the FAQ though, because there are some known problems. #### Windows-Specific Build Problems One problem specific to Windows is that apparently it doesn't let you free memory in a DLL that was allocated in the main program or in another DLL, or vice versa. This can cause trouble when setting your own notice handlers to process error or warning output. Recommended practice is to build libpqxx as a static library, not a DLL. Documentation ------------- The doc/ directory contains API reference documentation and a tutorial, both in HTML format. These are also available online. For more detailed information, look at the header files themselves. These are in the include/pqxx/ directory. The reference documentation is extracted from the headers using a program called Doxygen. When learning about programming with libpqxx, you'll want to start off by reading about the `connection_base` class and its children, as well as the `transaction_base` class. For programming examples, take a look at the test programs in the test/ directory. If you don't know how a certain function or class is used, try searching the test programs for that name. Programming with libpqxx ------------------------ Your first program will involve the libpqxx classes "connection" (see headers `pqxx/connection_base.hxx` and `pqxx/connection.hxx`), and `work` (a convenience alias for `transaction<>` which conforms to the interface defined in `pqxx/transaction_base.hxx`). These `*.hxx` headers are not the ones you include in your program. Instead, include the versions without filename suffix (e.g. `pqxx/connection_base`). Those will include the actual .hxx files for you. This was done so that includes are in standard C++ style (as in `` etc.), but an editor will still recognize them as files containing C++ code. Continuing the list of classes, you will most likely also need the result class (`pqxx/result.hxx`). In a nutshell, you create a `connection` based on a Postgres connection string (see below), create a `work` in the context of that connection, and run one or more queries on the work which return `result` objects. The results are containers of rows of data, each of which you can treat as an array of strings: one for each field in the row. It's that simple. Here is a simple example program to get you going, with full error handling: ```c++ #include #include int main() { try { pqxx::connection C; std::cout << "Connected to " << C.dbname() << std::endl; pqxx::work W(C); pqxx::result R = W.exec("SELECT name FROM employee"); std::cout << "Found " << R.size() << "employees:" << std::endl; for (auto row: R) std::cout << row[0].c_str() << std::endl; std::cout << "Doubling all employees' salaries..." << std::endl; W.exec("UPDATE employee SET salary = salary*2"); std::cout << "Making changes definite: "; W.commit(); std::cout << "OK." << std::endl; } catch (const std::exception &e) { std::cerr << e.what() << std::endl; return 1; } return 0; } ``` Connection strings ------------------ Postgres connection strings state which database server you wish to connect to, under which username, using which password, and so on. Their format is defined in the documentation for libpq, the C client interface for PostgreSQL. Alternatively, these values may be defined by setting certain environment variables as documented in e.g. the manual for psql, the command line interface to PostgreSQL. Again the definitions are the same for libpqxx-based programs. The connection strings and variables are not fully and definitively documented here; this document will tell you just enough to get going. Check the PostgreSQL documentation for authoritative information. The connection string consists of attribute=value pairs separated by spaces, e.g. "user=john password=1x2y3z4". The valid attributes include: - `host` Name of server to connect to, or the full file path (beginning with a slash) to a Unix-domain socket on the local machine. Defaults to "/tmp". Equivalent to (but overrides) environment variable PGHOST. - `hostaddr` IP address of a server to connect to; mutually exclusive with "host". - `port` Port number at the server host to connect to, or socket file name extension for Unix-domain connections. Equivalent to (but overrides) environment variable PGPORT. - `dbname` Name of the database to connect to. A single server may host multiple databases. Defaults to the same name as the current user's name. Equivalent to (but overrides) environment variable PGDATABASE. - `user` User name to connect under. This defaults to the name of the current user, although PostgreSQL users are not necessarily the same thing as system users. - `requiressl` If set to 1, demands an encrypted SSL connection (and fails if no SSL connection can be created). Settings in the connection strings override the environment variables, which in turn override the default, on a variable-by-variable basis. You only need to define those variables that require non-default values. Linking with libpqxx -------------------- To link your final program, make sure you link to both the C-level libpq library and the actual C++ library, libpqxx. With most Unix-style compilers, you'd do this using the options ``` -lpqxx -lpq ``` while linking. Both libraries must be in your link path, so the linker knows where to find them. Any dynamic libraries you use must also be in a place where the loader can find them when loading your program at runtime. Some users have reported problems using the above syntax, however, particularly when multiple versions of libpqxx are partially or incorrectly installed on the system. If you get massive link errors, try removing the "-lpqxx" argument from the command line and replacing it with the name of the libpqxx library binary instead. That's typically libpqxx.a, but you'll have to add the path to its location as well, e.g. /usr/local/pqxx/lib/libpqxx.a. This will ensure that the linker will use that exact version of the library rather than one found elsewhere on the system, and eliminate worries about the exact right version of the library being installed with your program.. libpqxx-6.4.5/VERSION000066400000000000000000000000061350065432700142660ustar00rootroot000000000000006.4.5 libpqxx-6.4.5/aclocal.m4000066400000000000000000002243401350065432700150670ustar00rootroot00000000000000# generated automatically by aclocal 1.15.1 -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_config_feature.html # =========================================================================== # # SYNOPSIS # # AX_CONFIG_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION, DEFINE, DEFINE-DESCRIPTION, [ACTION-IF-ENABLED [, ACTION-IF-NOT-ENABLED]]) # # DESCRIPTION # # AX_CONFIG_FEATURE is a simple wrapper for AC_ARG_ENABLE, it enables the # feature FEATURE-NAME and AC_DEFINEs the passed DEFINE, depending on the # user choice. DESCRIPTION will be used for AC_DEFINEs. ACTION-IF-ENABLED # and ACTION-IF-NOT-ENABLED are the actions that will be run. A feature is # enabled by default, in order to change this behaviour use the # AX_CONFIG_FEATURE_DEFAULT_ENABLED and AX_CONFIG_FEATURE_DEFAULT_DISABLED # macros. # # A simple example: # # AX_CONFIG_FEATURE_DEFAULT_ENABLED # AX_CONFIG_FEATURE(feature_xxxxx, [turns on/off XXXXX support], # HAVE_XXXXX, [Define if you want XXXXX support]) # # ... # # AX_CONFIG_FEATURE_DEFAULT_DISABLED # AX_CONFIG_FEATURE(feature_yyyyy, [turns on/off YYYYY support], # HAVE_YYYYY, [Define if you want YYYYY support], # [enable_yyyyy="yes"], [enable_yyyyy="no"]) # AM_CONDITIONAL(YYYYY, [test "$enable_yyyyy" = "yes"]) # # AX_CONFIG_FEATURE_DEFAULT_ENABLED # AX_CONFIG_FEATURE(...) # # ... # # If you have lot of features and you want a verbose dumping of each user # selection use AX_CONFIG_FEATURE_VERBOSE. Use AX_CONFIG_FEATURE_SILENT in # order to remove a previously AX_CONFIG_FEATURE_VERBOSE. By default # features are silent. # # Use AX_CONFIG_FEATURE_ENABLE or AX_CONFIG_FEATURE_DISABLE in order to # enable or disable a specific feature. # # Another simple example: # # AS_IF([some_test_here],[AX_CONFIG_FEATURE_ENABLE(feature_xxxxx)],[]) # # AX_CONFIG_FEATURE(feature_xxxxx, [turns on/off XXXXX support], # HAVE_XXXXX, [Define if you want XXXXX support]) # AX_CONFIG_FEATURE(feature_yyyyy, [turns on/off YYYYY support], # HAVE_YYYYY, [Define if you want YYYYY support], # [enable_yyyyy="yes"], [enable_yyyyy="no"]) # # ... # # NOTE: AX_CONFIG_FEATURE_ENABLE() must be placed first of the relative # AX_CONFIG_FEATURE() macro ... # # LICENSE # # Copyright (c) 2008 Francesco Salvestrini # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 11 AC_DEFUN([AX_CONFIG_FEATURE],[ dnl m4_pushdef([FEATURE], patsubst([$1], -, _))dnl AC_ARG_ENABLE([$1],AS_HELP_STRING([--enable-$1],[$2]),[ case "${enableval}" in yes) ax_config_feature_[]FEATURE[]="yes" ;; no) ax_config_feature_[]FEATURE[]="no" ;; *) AC_MSG_ERROR([bad value ${enableval} for feature --$1]) ;; esac ]) AS_IF([test "$ax_config_feature_[]FEATURE[]" = yes],[ dnl AC_DEFINE([$3]) $5 AS_IF([test "$ax_config_feature_verbose" = yes],[ dnl AC_MSG_NOTICE([Feature $1 is enabled]) ]) ],[ dnl $6 AS_IF([test "$ax_config_feature_verbose" = yes],[ dnl AC_MSG_NOTICE([Feature $1 is disabled]) ]) ]) AH_TEMPLATE([$3],[$4]) m4_popdef([FEATURE])dnl ]) dnl Feature global AC_DEFUN([AX_CONFIG_FEATURE_VERBOSE],[ dnl ax_config_feature_verbose=yes ]) dnl Feature global AC_DEFUN([AX_CONFIG_FEATURE_SILENT],[ dnl ax_config_feature_verbose=no ]) dnl Feature specific AC_DEFUN([AX_CONFIG_FEATURE_DEFAULT_ENABLED], [ ax_config_feature_[]FEATURE[]_default=yes ]) dnl Feature specific AC_DEFUN([AX_CONFIG_FEATURE_DEFAULT_DISABLED], [ ax_config_feature_[]FEATURE[]_default=no ]) dnl Feature specific AC_DEFUN([AX_CONFIG_FEATURE_ENABLE],[ dnl ax_config_feature_[]patsubst([$1], -, _)[]=yes ]) dnl Feature specific AC_DEFUN([AX_CONFIG_FEATURE_DISABLE],[ dnl ax_config_feature_[]patsubst([$1], -, _)[]=no ]) # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) # or '14' (for the C++14 standard). # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is # required and that the macro should error out if no mode with that # support is found. If specified 'optional', then configuration proceeds # regardless, after defining HAVE_CXX${VERSION} if and only if a # supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # Copyright (c) 2016 Krzesimir Nowak # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 7 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AX_REQUIRE_DEFINED([AC_MSG_WARN]) AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], [$1], [14], [ax_cxx_compile_alternatives="14 1y"], [$1], [17], [ax_cxx_compile_alternatives="17 1z"], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], [$2], [noext], [], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], [$3], [optional], [ax_cxx_compile_cxx$1_required=false], [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, ax_cv_cxx_compile_cxx$1, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [ax_cv_cxx_compile_cxx$1=yes], [ax_cv_cxx_compile_cxx$1=no])]) if test x$ax_cv_cxx_compile_cxx$1 = xyes; then ac_success=yes fi m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do switch="-std=gnu++${alternative}" cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi]) m4_if([$2], [ext], [], [dnl if test x$ac_success = xno; then dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx$1_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) fi fi if test x$ac_success = xno; then HAVE_CXX$1=0 AC_MSG_NOTICE([No compiler with C++$1 support was found]) else HAVE_CXX$1=1 AC_DEFINE(HAVE_CXX$1,1, [define if the compiler supports basic C++$1 syntax]) fi AC_SUBST(HAVE_CXX$1) m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) ]) dnl Test body for checking C++11 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 ) dnl Tests for new features in C++11 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L ]]) dnl Tests for new features in C++14 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_separators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L ]]) dnl Tests for new features in C++17 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ // If the compiler admits that it is not ready for C++17, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus <= 201402L #error "This is not a C++17 compiler" #else #if defined(__clang__) #define REALLY_CLANG #else #if defined(__GNUC__) #define REALLY_GCC #endif #endif #include #include #include namespace cxx17 { #if !defined(REALLY_CLANG) namespace test_constexpr_lambdas { // TODO: test it with clang++ from git constexpr int foo = [](){return 42;}(); } #endif // !defined(REALLY_CLANG) namespace test::nested_namespace::definitions { } namespace test_fold_expression { template int multiply(Args... args) { return (args * ... * 1); } template bool all(Args... args) { return (args && ...); } } namespace test_extended_static_assert { static_assert (true); } namespace test_auto_brace_init_list { auto foo = {5}; auto bar {5}; static_assert(std::is_same, decltype(foo)>::value); static_assert(std::is_same::value); } namespace test_typename_in_template_template_parameter { template typename X> struct D; } namespace test_fallthrough_nodiscard_maybe_unused_attributes { int f1() { return 42; } [[nodiscard]] int f2() { [[maybe_unused]] auto unused = f1(); switch (f1()) { case 17: f1(); [[fallthrough]]; case 42: f1(); } return f1(); } } namespace test_extended_aggregate_initialization { struct base1 { int b1, b2 = 42; }; struct base2 { base2() { b3 = 42; } int b3; }; struct derived : base1, base2 { int d; }; derived d1 {{1, 2}, {}, 4}; // full initialization derived d2 {{}, {}, 4}; // value-initialized bases } namespace test_general_range_based_for_loop { struct iter { int i; int& operator* () { return i; } const int& operator* () const { return i; } iter& operator++() { ++i; return *this; } }; struct sentinel { int i; }; bool operator== (const iter& i, const sentinel& s) { return i.i == s.i; } bool operator!= (const iter& i, const sentinel& s) { return !(i == s); } struct range { iter begin() const { return {0}; } sentinel end() const { return {5}; } }; void f() { range r {}; for (auto i : r) { [[maybe_unused]] auto v = i; } } } namespace test_lambda_capture_asterisk_this_by_value { struct t { int i; int foo() { return [*this]() { return i; }(); } }; } namespace test_enum_class_construction { enum class byte : unsigned char {}; byte foo {42}; } namespace test_constexpr_if { template int f () { if constexpr(cond) { return 13; } else { return 42; } } } namespace test_selection_statement_with_initializer { int f() { return 13; } int f2() { if (auto i = f(); i > 0) { return 3; } switch (auto i = f(); i + 4) { case 17: return 2; default: return 1; } } } #if !defined(REALLY_CLANG) namespace test_template_argument_deduction_for_class_templates { // TODO: test it with clang++ from git template struct pair { pair (T1 p1, T2 p2) : m1 {p1}, m2 {p2} {} T1 m1; T2 m2; }; void f() { [[maybe_unused]] auto p = pair{13, 42u}; } } #endif // !defined(REALLY_CLANG) namespace test_non_type_auto_template_parameters { template struct B {}; B<5> b1; B<'a'> b2; } #if !defined(REALLY_CLANG) namespace test_structured_bindings { // TODO: test it with clang++ from git int arr[2] = { 1, 2 }; std::pair pr = { 1, 2 }; auto f1() -> int(&)[2] { return arr; } auto f2() -> std::pair& { return pr; } struct S { int x1 : 2; volatile double y1; }; S f3() { return {}; } auto [ x1, y1 ] = f1(); auto& [ xr1, yr1 ] = f1(); auto [ x2, y2 ] = f2(); auto& [ xr2, yr2 ] = f2(); const auto [ x3, y3 ] = f3(); } #endif // !defined(REALLY_CLANG) #if !defined(REALLY_CLANG) namespace test_exception_spec_type_system { // TODO: test it with clang++ from git struct Good {}; struct Bad {}; void g1() noexcept; void g2(); template Bad f(T*, T*); template Good f(T1*, T2*); static_assert (std::is_same_v); } #endif // !defined(REALLY_CLANG) namespace test_inline_variables { template void f(T) {} template inline T g(T) { return T{}; } template<> inline void f<>(int) {} template<> int g<>(int) { return 5; } } } // namespace cxx17 #endif // __cplusplus <= 201402L ]]) # ============================================================================= # https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================= # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++11. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 18 AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_gcc_const_call.html # =========================================================================== # # SYNOPSIS # # AX_GCC_CONST_CALL # # DESCRIPTION # # The macro will compile a test program to see whether the compiler does # understand the per-function postfix pragma. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 8 AC_DEFUN([AX_GCC_CONST_CALL],[dnl AC_CACHE_CHECK( [whether the compiler supports function __attribute__((__const__))], ax_cv_gcc_const_call,[ AC_TRY_COMPILE([__attribute__((__const__)) int f(int i) { return i; }], [], ax_cv_gcc_const_call=yes, ax_cv_gcc_const_call=no)]) if test "$ax_cv_gcc_const_call" = yes; then AC_DEFINE([GCC_CONST_CALL],[__attribute__((__const__))], [most gcc compilers know a function __attribute__((__const__))]) fi ]) # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_have_poll.html # =========================================================================== # # SYNOPSIS # # AX_HAVE_POLL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # AX_HAVE_PPOLL([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # DESCRIPTION # # This macro determines whether the system supports the poll I/O event # interface. A neat usage example would be: # # AX_HAVE_POLL( # [AX_CONFIG_FEATURE_ENABLE(poll)], # [AX_CONFIG_FEATURE_DISABLE(poll)]) # AX_CONFIG_FEATURE( # [poll], [This platform supports poll(7)], # [HAVE_POLL], [This platform supports poll(7).]) # # Some systems -- most notably Linux kernel 2.6.16 and later -- also have # the variant ppoll(). The availability of that function can be tested # with the second macro. Generally speaking, it is safe to assume that # AX_HAVE_POLL would succeed if AX_HAVE_PPOLL has, but not the other way # round. # # LICENSE # # Copyright (c) 2009 Peter Simons # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 8 AC_DEFUN([AX_HAVE_POLL], [dnl AC_MSG_CHECKING([for poll(2)]) AC_CACHE_VAL([ax_cv_have_poll], [dnl AC_LINK_IFELSE([dnl AC_LANG_PROGRAM( [#include ], [int rc; rc = poll((struct pollfd *)(0), 0, 0);])], [ax_cv_have_poll=yes], [ax_cv_have_poll=no])]) AS_IF([test "${ax_cv_have_poll}" = "yes"], [AC_MSG_RESULT([yes]) $1],[AC_MSG_RESULT([no]) $2]) ])dnl AC_DEFUN([AX_HAVE_PPOLL], [dnl AC_MSG_CHECKING([for ppoll(2)]) AC_CACHE_VAL([ax_cv_have_ppoll], [dnl AC_LINK_IFELSE([dnl AC_LANG_PROGRAM( [dnl #include #include ], [dnl int rc; rc = poll((struct pollfd *)(0), 0, 0); rc = ppoll((struct pollfd *)(0), 0, (struct timespec const *)(0), (sigset_t const *)(0));])], [ax_cv_have_ppoll=yes], [ax_cv_have_ppoll=no])]) AS_IF([test "${ax_cv_have_ppoll}" = "yes"], [AC_MSG_RESULT([yes]) $1],[AC_MSG_RESULT([no]) $2]) ]) # Copyright (C) 2002-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([config/m4/libtool.m4]) m4_include([config/m4/ltoptions.m4]) m4_include([config/m4/ltsugar.m4]) m4_include([config/m4/ltversion.m4]) m4_include([config/m4/lt~obsolete.m4]) libpqxx-6.4.5/autogen.sh000077500000000000000000000033371350065432700152310ustar00rootroot00000000000000#! /bin/sh # Run this to generate all the initial makefiles, etc. # # Set CONFIG_ARGS to the argument list you wish to pass to configure. set -eu PQXXVERSION=$(./tools/extract_version) PQXX_ABI=$(./tools/extract_version --abi) PQXX_MAJOR=$(./tools/extract_version --major) PQXX_MINOR=$(./tools/extract_version --minor) echo "libpqxx version $PQXXVERSION" echo "libpqxx ABI version $PQXX_ABI" substitute() { sed -e "s/@PQXXVERSION@/$PQXXVERSION/g" \ -e "s/@PQXX_MAJOR@/$PQXX_MAJOR/g" \ -e "s/@PQXX_MINOR@/$PQXX_MINOR/g" \ -e "s/@PQXX_ABI@/$PQXX_ABI/g" \ "$1" } # Generate Windows makefiles. # Add carriage returns to turn them into MS-DOS format. makewinmake() { ./tools/template2mak.py "$1" | tr -d '\r' | sed -e 's/$/\r/' >"$2" } # Use templating system to generate various Makefiles. expand_templates() { for template in $@ do ./tools/template2mak.py "$template" "${template%.template}" done # Ensure CR/LF line endings for the Windows files we generate. for template in win32/*.mak.template do sed "${template%.template}" -i -e 's/\r*$/\r/' done } # Expand templates using our custom templating tool. Skip the version.hxx # template; that header gets generated in a completely different way. expand_templates $(find -name \*.template | grep -v version.hxx) # Generate version header. substitute include/pqxx/version.hxx.template >include/pqxx/version.hxx autoheader libtoolize --force --automake --copy aclocal -I . -I config/m4 automake --add-missing --copy autoconf conf_flags="--enable-maintainer-mode ${CONFIG_ARGS:-}" if [ -z "${NOCONFIGURE:-}" ] then echo Running ./configure $conf_flags "$@" ... ./configure $conf_flags "$@" echo "Now type 'make' to compile libpqxx." else echo Skipping configure process. fi libpqxx-6.4.5/cmake/000077500000000000000000000000001350065432700143025ustar00rootroot00000000000000libpqxx-6.4.5/cmake/config.cmake000066400000000000000000000062411350065432700165540ustar00rootroot00000000000000function(detect_code_compiled code macro msg) message(STATUS "Detecting ${msg}") check_cxx_source_compiles("${code}" "${macro}" FAIL_REGEX "warning") if (${macro}) message(STATUS "Detecting ${msg} - supported") else (${macro}) message(STATUS "Detecting ${msg} - not supported") endif (${macro}) endfunction(detect_code_compiled) function(detect_attribute attr macro) if (${ARGC} EQUAL 3) set(attr_name "${ARGN}") else () set(attr_name "${attr}") endif () detect_code_compiled(" int foo() __attribute__ ((${attr})); int main() { return 0; } " "${macro}" "__attribute__ ((${attr_name}))") endfunction(detect_attribute) include(CheckIncludeFileCXX) include(CheckFunctionExists) include(CMakeDetermineCompileFeatures) include(CheckCXXSourceCompiles) check_include_file_cxx("sys/select.h" HAVE_SYS_SELECT_H) check_include_file_cxx("sys/time.h" HAVE_SYS_TIME_H) check_include_file_cxx("sys/types.h" HAVE_SYS_TYPES_H) check_include_file_cxx("unistd.h" HAVE_UNISTD_H) check_function_exists("poll" HAVE_POLL) cmake_determine_compile_features(CXX) cmake_policy(SET CMP0057 NEW) if (cxx_attribute_deprecated IN_LIST CMAKE_CXX_COMPILE_FEATURES) set(PQXX_HAVE_DEPRECATED) endif () # detect_cxx_feature("cxx_attribute_deprecated" "PQXX_HAVE_DEPRECATED") # check_cxx_source_compiles requires CMAKE_REQUIRED_DEFINITIONS to specify # compiling arguments. # Wordaround: Push CMAKE_REQUIRED_DEFINITIONS if (CMAKE_REQUIRED_DEFINITIONS) set(def "${CMAKE_REQUIRED_DEFINITIONS}") endif (CMAKE_REQUIRED_DEFINITIONS) set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}) set(CMAKE_REQUIRED_QUIET ON) # Detect std::optional detect_code_compiled(" #include int main() { std::optional o; } " PQXX_HAVE_OPTIONAL "std::optional") # Detect std::experimental::optional detect_code_compiled(" #include int main() { std::experimental::optional o; } " PQXX_HAVE_EXP_OPTIONAL "std::experimental::optional") detect_attribute("const" PQXX_HAVE_GCC_CONST) detect_attribute("pure" PQXX_HAVE_GCC_PURE) detect_attribute("visibility(\"default\")" PQXX_HAVE_GCC_VISIBILITY "visibility") # check_cxx_source_compiles requires CMAKE_REQUIRED_DEFINITIONS to specify # compiling arguments. # Wordaround: Pop CMAKE_REQUIRED_DEFINITIONS if (def) set(CMAKE_REQUIRED_DEFINITIONS ${def}) unset(def CACHE) else (def) unset(CMAKE_REQUIRED_DEFINITIONS CACHE) endif (def) set(CMAKE_REQUIRED_QUIET OFF) set(AC_CONFIG_H_IN "${PROJECT_SOURCE_DIR}/include/pqxx/config.h.in") set(CM_CONFIG_H_IN "${PROJECT_BINARY_DIR}/include/pqxx/config_cmake.h.in") set(CM_CONFIG_PUB "${PROJECT_BINARY_DIR}/include/pqxx/config-public-compiler.h") set(CM_CONFIG_INT "${PROJECT_BINARY_DIR}/include/pqxx/config-internal-compiler.h") message(STATUS "Generating config.h") file(WRITE "${CM_CONFIG_H_IN}" "") file(STRINGS "${AC_CONFIG_H_IN}" lines) foreach (line ${lines}) string(REGEX REPLACE "^#undef" "#cmakedefine" l "${line}") file(APPEND "${CM_CONFIG_H_IN}" "${l}\n") endforeach (line) configure_file("${CM_CONFIG_H_IN}" "${CM_CONFIG_INT}" @ONLY) configure_file("${CM_CONFIG_H_IN}" "${CM_CONFIG_PUB}" @ONLY) message(STATUS "Generating config.h - done") libpqxx-6.4.5/cmake/libpqxx-config.cmake000066400000000000000000000001721350065432700202360ustar00rootroot00000000000000include(CMakeFindDependencyMacro) find_dependency(PostgreSQL) include("${CMAKE_CURRENT_LIST_DIR}/libpqxx-targets.cmake") libpqxx-6.4.5/config/000077500000000000000000000000001350065432700144675ustar00rootroot00000000000000libpqxx-6.4.5/config/Makefile.am000066400000000000000000000004341350065432700165240ustar00rootroot00000000000000EXTRA_DIST=m4/Makefile.am sample-headers MAINTAINERCLEANFILES=Makefile.in config.guess config.sub install-sh \ ltmain.sh missing mkinstalldirs dist-hook: find "${distdir}" -type d -name CVS -print0 | xargs -0 rm -rf find "${distdir}" -type d -name .svn -print0 | xargs -0 rm -rf libpqxx-6.4.5/config/Makefile.in000066400000000000000000000314221350065432700165360ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in compile config.guess \ config.sub install-sh ltmain.sh missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ EXTRA_DIST = m4/Makefile.am sample-headers MAINTAINERCLEANFILES = Makefile.in config.guess config.sub install-sh \ ltmain.sh missing mkinstalldirs all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu config/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am dist-hook distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile dist-hook: find "${distdir}" -type d -name CVS -print0 | xargs -0 rm -rf find "${distdir}" -type d -name .svn -print0 | xargs -0 rm -rf # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/config/config.guess000077500000000000000000001276371350065432700170270ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2009-12-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 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) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libpqxx-6.4.5/config/config.sub000077500000000000000000001034451350065432700164610ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libpqxx-6.4.5/config/depcomp000077500000000000000000000560171350065432700160550ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2016-01-11.22; # UTC # Copyright (C) 1999-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: libpqxx-6.4.5/config/install-sh000077500000000000000000000325371350065432700165050ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libpqxx-6.4.5/config/ltmain.sh000066400000000000000000011714741350065432700163260ustar00rootroot00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.6 Debian-2.4.6-2" package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.4.6-2 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type '$version_type'" ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: libpqxx-6.4.5/config/m4/000077500000000000000000000000001350065432700150075ustar00rootroot00000000000000libpqxx-6.4.5/config/m4/Makefile.am000066400000000000000000000001501350065432700170370ustar00rootroot00000000000000MAINTAINERCLEANFILES=Makefile.in config.guess config.sub install-sh \ ltmain.sh missing mkinstalldirs libpqxx-6.4.5/config/m4/libtool.m4000066400000000000000000011261711350065432700167260ustar00rootroot00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS libpqxx-6.4.5/config/m4/ltoptions.m4000066400000000000000000000342621350065432700173130ustar00rootroot00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) libpqxx-6.4.5/config/m4/ltsugar.m4000066400000000000000000000104401350065432700167310ustar00rootroot00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) libpqxx-6.4.5/config/m4/ltversion.m4000066400000000000000000000012731350065432700173010ustar00rootroot00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) libpqxx-6.4.5/config/m4/lt~obsolete.m4000066400000000000000000000137741350065432700176370ustar00rootroot00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) libpqxx-6.4.5/config/missing000077500000000000000000000153301350065432700160700ustar00rootroot00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libpqxx-6.4.5/config/mkinstalldirs000077500000000000000000000012371350065432700173000ustar00rootroot00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id$ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here libpqxx-6.4.5/config/sample-headers/000077500000000000000000000000001350065432700173615ustar00rootroot00000000000000libpqxx-6.4.5/config/sample-headers/compiler/000077500000000000000000000000001350065432700211735ustar00rootroot00000000000000libpqxx-6.4.5/config/sample-headers/compiler/VisualStudio2013/000077500000000000000000000000001350065432700241345ustar00rootroot00000000000000libpqxx-6.4.5/config/sample-headers/compiler/VisualStudio2013/pqxx/000077500000000000000000000000001350065432700251345ustar00rootroot00000000000000libpqxx-6.4.5/config/sample-headers/compiler/VisualStudio2013/pqxx/config-internal-compiler.h000066400000000000000000000000671350065432700321770ustar00rootroot00000000000000#define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_TYPES_H 1 libpqxx-6.4.5/config/sample-headers/compiler/VisualStudio2013/pqxx/config-public-compiler.h000066400000000000000000000000371350065432700316360ustar00rootroot00000000000000#define PQXX_PQ_IN_NAMESPACE 1 libpqxx-6.4.5/config/sample-headers/compiler/gcc-7.2/000077500000000000000000000000001350065432700222335ustar00rootroot00000000000000libpqxx-6.4.5/config/sample-headers/compiler/gcc-7.2/pqxx/000077500000000000000000000000001350065432700232335ustar00rootroot00000000000000libpqxx-6.4.5/config/sample-headers/compiler/gcc-7.2/pqxx/config-internal-compiler.h000066400000000000000000000002361350065432700302740ustar00rootroot00000000000000/* Automatically generated from config.h: internal/compiler config. */ #define HAVE_SYS_TYPES_H 1 #define HAVE_UNISTD_H 1 #define PQXX_HAVE_GCC_VISIBILITY 1 libpqxx-6.4.5/config/sample-headers/compiler/gcc-7.2/pqxx/config-public-compiler.h000066400000000000000000000003011350065432700277270ustar00rootroot00000000000000/* Automatically generated from config.h: public/compiler config. */ #define PQXX_HAVE_DEPRECATED 1 #define PQXX_HAVE_EXP_OPTIONAL 1 #define PQXX_HAVE_GCC_CONST 1 #define PQXX_HAVE_GCC_PURE 1 libpqxx-6.4.5/config/test-driver000077500000000000000000000110401350065432700166610ustar00rootroot00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: libpqxx-6.4.5/configitems000066400000000000000000000015071350065432700154570ustar00rootroot00000000000000HAVE_POLL internal compiler HAVE_SYS_SELECT_H internal compiler HAVE_SYS_TIME_H internal compiler HAVE_SYS_TYPES_H internal compiler HAVE_UNISTD_H internal compiler PACKAGE internal autotools PACKAGE_BUGREPORT internal autotools PACKAGE_NAME internal autotools PACKAGE_STRING internal autotools PACKAGE_TARNAME internal autotools PACKAGE_VERSION internal autotools PQXX_HAVE_CHARCONV_INT internal compiler PQXX_HAVE_CHARCONV_FLOAT internal compiler PQXX_HAVE_GCC_CONST public compiler PQXX_HAVE_GCC_DEPRECATED public compiler PQXX_HAVE_GCC_PURE public compiler PQXX_HAVE_DEPRECATED public compiler PQXX_HAVE_GCC_VISIBILITY internal compiler PQXX_HAVE_OPTIONAL public compiler PQXX_HAVE_EXP_OPTIONAL public compiler PQXX_SEEKDIRS_MATCH_C internal compiler PQXX_PQ_IN_NAMESPACE public compiler VERSION internal autotools libpqxx-6.4.5/configure000077500000000000000000023420561350065432700151450ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libpqxx 6.4.4. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and Jeroen T. $0: Vermeulen about your system, including any error $0: possibly output before this message. Then install a $0: modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libpqxx' PACKAGE_TARNAME='libpqxx' PACKAGE_VERSION='6.4.4' PACKAGE_STRING='libpqxx 6.4.4' PACKAGE_BUGREPORT='Jeroen T. Vermeulen' PACKAGE_URL='' ac_unique_file="src/connection.cxx" ac_default_prefix=/usr/local # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS POSTGRES_LIB with_postgres_lib POSTGRES_INCLUDE with_postgres_include PKG_CONFIG PG_CONFIG MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE BUILD_TUTORIAL_FALSE BUILD_TUTORIAL_TRUE BUILD_REFERENCE_FALSE BUILD_REFERENCE_TRUE XMLTO HAVE_DOT DOXYGEN MKDIR CXXCPP CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL PQXX_ABI PQXXVERSION AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM HAVE_CXX11 OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking enable_silent_rules enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock enable_documentation enable_maintainer_mode enable_audit enable_poll with_postgres_include with_postgres_lib ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS LT_SYS_LIBRARY_PATH CPP CXXCPP DOXYGEN HAVE_DOT XMLTO' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libpqxx 6.4.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libpqxx] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of libpqxx 6.4.4:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-shared[=PKGS] build shared libraries [default=no] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-documentation Generate documentation --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-poll System supports poll(). Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-postgres-include=DIR Use PostgreSQL includes from DIR. Defaults to querying pg_config or pkg-config, whichever is available. --with-postgres-lib=DIR Use PostgreSQL libraries from DIR. Defaults to querying pg_config. Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor CXXCPP C++ preprocessor DOXYGEN Path to doxygen needed to build reference documentation HAVE_DOT Variable used by doxygen to declare availibility of dot XMLTO Path to xmlto needed to build tutorial documentation Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF libpqxx configure 6.4.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------- ## ## Report this to Jeroen T. Vermeulen ## ## ---------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libpqxx $as_me 6.4.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Require C++11 at minimum. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } if ${ax_cv_cxx_compile_cxx11+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_cxx_compile_cxx11=yes else ax_cv_cxx_compile_cxx11=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi if test x$ac_success = xno; then for alternative in ${ax_cxx_compile_alternatives}; do for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval $cachevar=yes else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done if test x$ac_success = xyes; then break fi done fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi fi if test x$ac_success = xno; then HAVE_CXX11=0 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libpqxx' VERSION='6.4.4' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi PQXX_ABI=6.4 ac_config_headers="$ac_config_headers include/pqxx/config.h" # Default prefix for installs. # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=no fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi link_all_deplibs=no else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC=$lt_save_CC if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MKDIR+:} false; then : $as_echo_n "(cached) " >&6 else case $MKDIR in [\\/]* | ?:[\\/]*) ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MKDIR=$ac_cv_path_MKDIR if test -n "$MKDIR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 $as_echo "$MKDIR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Documentation. # Check whether --enable-documentation was given. if test "${enable_documentation+set}" = set; then : enableval=$enable_documentation; else enable_documentation=auto fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}doxygen", so it can be a program name with args. set dummy ${ac_tool_prefix}doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_DOXYGEN="$DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOXYGEN=$ac_cv_path_DOXYGEN if test -n "$DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 $as_echo "$DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_DOXYGEN"; then ac_pt_DOXYGEN=$DOXYGEN # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_DOXYGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_DOXYGEN in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_DOXYGEN="$ac_pt_DOXYGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_DOXYGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_DOXYGEN=$ac_cv_path_ac_pt_DOXYGEN if test -n "$ac_pt_DOXYGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_DOXYGEN" >&5 $as_echo "$ac_pt_DOXYGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_DOXYGEN" = x; then DOXYGEN="nodoxygen" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DOXYGEN=$ac_pt_DOXYGEN fi else DOXYGEN="$ac_cv_path_DOXYGEN" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dot", so it can be a program name with args. set dummy ${ac_tool_prefix}dot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_DOT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_DOT"; then ac_cv_prog_HAVE_DOT="$HAVE_DOT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in NO do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_DOT="${ac_tool_prefix}dot" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_DOT=$ac_cv_prog_HAVE_DOT if test -n "$HAVE_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DOT" >&5 $as_echo "$HAVE_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_HAVE_DOT"; then ac_ct_HAVE_DOT=$HAVE_DOT # Extract the first word of "dot", so it can be a program name with args. set dummy dot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_HAVE_DOT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_HAVE_DOT"; then ac_cv_prog_ac_ct_HAVE_DOT="$ac_ct_HAVE_DOT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in NO do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_HAVE_DOT="dot" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_HAVE_DOT=$ac_cv_prog_ac_ct_HAVE_DOT if test -n "$ac_ct_HAVE_DOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_HAVE_DOT" >&5 $as_echo "$ac_ct_HAVE_DOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_HAVE_DOT" = x; then HAVE_DOT="YES" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac HAVE_DOT=$ac_ct_HAVE_DOT fi else HAVE_DOT="$ac_cv_prog_HAVE_DOT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}xmlto", so it can be a program name with args. set dummy ${ac_tool_prefix}xmlto; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XMLTO+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLTO in [\\/]* | ?:[\\/]*) ac_cv_path_XMLTO="$XMLTO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XMLTO=$ac_cv_path_XMLTO if test -n "$XMLTO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLTO" >&5 $as_echo "$XMLTO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_XMLTO"; then ac_pt_XMLTO=$XMLTO # Extract the first word of "xmlto", so it can be a program name with args. set dummy xmlto; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_XMLTO+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_XMLTO in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_XMLTO="$ac_pt_XMLTO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_XMLTO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_XMLTO=$ac_cv_path_ac_pt_XMLTO if test -n "$ac_pt_XMLTO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_XMLTO" >&5 $as_echo "$ac_pt_XMLTO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_XMLTO" = x; then XMLTO="noxmlto" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac XMLTO=$ac_pt_XMLTO fi else XMLTO="$ac_cv_path_XMLTO" fi if test "$enable_documentation" = "yes" && test "$DOXYGEN" = "nodoxygen" -o "$XMLTO" = "noxmlto"; then : as_fn_error $? "could not files tools necessary to build documentation" "$LINENO" 5 fi if test "$enable_documentation" != "no" -a "$DOXYGEN" != "nodoxygen"; then BUILD_REFERENCE_TRUE= BUILD_REFERENCE_FALSE='#' else BUILD_REFERENCE_TRUE='#' BUILD_REFERENCE_FALSE= fi if test "$enable_documentation" != "no" -a "$XMLTO" != "xmlto"; then BUILD_TUTORIAL_TRUE= BUILD_TUTORIAL_FALSE='#' else BUILD_TUTORIAL_TRUE='#' BUILD_TUTORIAL_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE # See if we want verbose compiler warnings. { $as_echo "$as_me:${as_lineno-$LINENO}: checking maintainer mode" >&5 $as_echo_n "checking maintainer mode... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_maintainer_mode}" >&5 $as_echo "${enable_maintainer_mode}" >&6; } # See if we want "audit," with loads of runtime checking. { $as_echo "$as_me:${as_lineno-$LINENO}: checking audit" >&5 $as_echo_n "checking audit... " >&6; } # Check whether --enable-audit was given. if test "${enable_audit+set}" = set; then : enableval=$enable_audit; fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${enable_audit}" >&5 $as_echo "${enable_audit}" >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; fi if test "${shared}" = "yes" ; then : CPPFLAGS="$CPPFLAGS -DPQXX_SHARED" fi # Add options to compiler command line, if compiler accepts them. add_compiler_opts_if_ok() { for option in $* do ACO_SAVE_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $option" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts $option" >&5 $as_echo_n "checking whether $CXX accepts $option... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : has_option=yes else has_option=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_option" >&5 $as_echo "$has_option" >&6; } if test "$has_option" = "no" ; then : CXXFLAGS="$ACO_SAVE_CXXFLAGS" fi done } # Add options to compiler command line, unconditionally. add_compiler_opts() { CXXFLAGS="$CXXFLAGS $*" } # Let's try to get the compiler to be helpful. # # (Omit options -Weffc++ and -Wabi because they currently yield too many # warnings in gcc's standard headers; omit -Wunreachable-code because it isn't # always right) if test "$GCC" = "yes" then # In maintainer mode, enable all the warning options we can. if test "$enable_maintainer_mode" = "yes" then # "Eternal" (FLW) g++ options. These have been around for # ages, and both g++ and clang++ support them. Don't bother # checking for support; just add them to the compiler options. add_compiler_opts \ -fstrict-enums \ -Werror \ -Wall \ -pedantic \ -Wcast-align \ -Wcast-qual \ -Wconversion \ -Wctor-dtor-privacy \ -Wendif-labels \ -Wextra \ -Wfloat-equal \ -Wformat=2 \ -Wformat-security \ -Wmissing-include-dirs \ -Wno-div-by-zero \ -Wnon-virtual-dtor \ -Wold-style-cast \ -Woverlength-strings \ -Woverloaded-virtual \ -Wpointer-arith \ -Wredundant-decls \ -Wshadow \ -Wsign-promo \ -Wwrite-strings \ -Wundef \ -Wunused # "Iffy" g++ options. Some reasonably current g++-like # compilers may not support these. add_compiler_opts_if_ok \ -fnothrow-opt \ -Wattribute-alias \ -Wextra-semi \ -Wlogical-op \ -Wrestrict \ -Wstringop-overflow \ -Wsuggest-override \ -Wzero-as-null-pointer-constant fi # In "audit," enable all runtime checks we can. if test "$enable_audit" = "yes" then add_compiler_opts_if_ok \ -fsanitize=address \ -fsanitize=leak \ -fsanitize=undefined \ -fsanitize-address-use-after-scope \ -fstack-protector-all fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking g++ visibility attribute" >&5 $as_echo_n "checking g++ visibility attribute... " >&6; } gcc_visibility=yes SAVE_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ struct __attribute__ ((visibility("hidden"))) d { d() {} void f() {} }; int main () { d D; D.f() ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define PQXX_HAVE_GCC_VISIBILITY 1" >>confdefs.h else gcc_visibility=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_visibility" >&5 $as_echo "$gcc_visibility" >&6; } CXXFLAGS="$SAVE_CXXFLAGS" if test "$gcc_visibility" = "yes" then # Make internal definitions accessible only to the library itself. # Only definitions marked PQXX_LIBEXPORT will be accessible. add_compiler_opts -fvisibility=hidden add_compiler_opts -fvisibility-inlines-hidden fi # Check gcc "const" attribute. (More like a stricter version of "pure"). { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports function __attribute__((__const__))" >&5 $as_echo_n "checking whether the compiler supports function __attribute__((__const__))... " >&6; } if ${ax_cv_gcc_const_call+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ __attribute__((__const__)) int f(int i) { return i; } int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_gcc_const_call=yes else ax_cv_gcc_const_call=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_gcc_const_call" >&5 $as_echo "$ax_cv_gcc_const_call" >&6; } if test "$ax_cv_gcc_const_call" = yes; then $as_echo "#define GCC_CONST_CALL __attribute__((__const__))" >>confdefs.h fi if test "$ax_cv_gcc_const_call" then $as_echo "#define PQXX_HAVE_GCC_CONST 1" >>confdefs.h fi if test "$deprecated" != "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking g++ deprecation attribute" >&5 $as_echo_n "checking g++ deprecation attribute... " >&6; } gcc_deprecated=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ __attribute__ ((deprecated)) void f(); int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define PQXX_HAVE_GCC_DEPRECATED 1" >>confdefs.h else gcc_deprecated=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_deprecated" >&5 $as_echo "$gcc_deprecated" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking g++ pure attribute" >&5 $as_echo_n "checking g++ pure attribute... " >&6; } gcc_pure=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ void __attribute__ ((pure)) f(); int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define PQXX_HAVE_GCC_PURE 1" >>confdefs.h else gcc_pure=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_pure" >&5 $as_echo "$gcc_pure" >&6; } fi # End of gcc-specific part. { $as_echo "$as_me:${as_lineno-$LINENO}: checking C++14 deprecation attribute" >&5 $as_echo_n "checking C++14 deprecation attribute... " >&6; } deprecated=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* */ [[deprecated]] void f(); int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define PQXX_HAVE_DEPRECATED 1" >>confdefs.h else deprecated=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $deprecated" >&5 $as_echo "$deprecated" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++17 std::optional support" >&5 $as_echo_n "checking for C++17 std::optional support... " >&6; } have_optional=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return std::optional(0).value() ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define PQXX_HAVE_OPTIONAL 1" >>confdefs.h else have_optional=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_optional" >&5 $as_echo "$have_optional" >&6; } if test "$have_optional" != "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for experimental C++17 std::optional support" >&5 $as_echo_n "checking for experimental C++17 std::optional support... " >&6; } have_exp_optional=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { return std::experimental::optional(0).value() ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define PQXX_HAVE_EXP_OPTIONAL 1" >>confdefs.h else have_exp_optional=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_exp_optional" >&5 $as_echo "$have_exp_optional" >&6; } fi # It's early 2019, and gcc's charconv supports integers but not yet floats. # So for now, we test for int and float conversion... separately. # # It's worse for clang, which compiles the integer conversions but then fails # at link time because of a missing symbol "__muloti4" when compiling # "long long" code. I couldn't resolve that symbol by adding -lm either. So # don't just compile these tests; link them as well. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++17 charconv integer conversion" >&5 $as_echo_n "checking for C++17 charconv integer conversion... " >&6; } have_charconv_int=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char z[100]; using ull = unsigned long long; auto rt = std::to_chars(z, z + sizeof(z), ull{0}); if (rt.ec != std::errc{}) return 1; ull n; auto rf = std::from_chars(z, z + sizeof(z), n); if (rf.ec != std::errc{}) return 2; return int(n) ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define PQXX_HAVE_CHARCONV_INT 1" >>confdefs.h else have_charconv_int=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_charconv_int" >&5 $as_echo "$have_charconv_int" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++17 charconv floating-point conversion" >&5 $as_echo_n "checking for C++17 charconv floating-point conversion... " >&6; } have_charconv_float=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char z[100]; using ld = long double; auto rt = std::to_chars( z, z + sizeof(z), ld{0.1}, std::chars_format::generic); if (rt.ec != std::errc{}) return 1; ld n; auto rf = std::from_chars(z, z + sizeof(z), n); if (rf.ec != std::errc{}) return 2; return int(n) ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : $as_echo "#define PQXX_HAVE_CHARCONV_FLOAT 1" >>confdefs.h else have_charconv_float=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_charconv_float" >&5 $as_echo "$have_charconv_float" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poll(2)" >&5 $as_echo_n "checking for poll(2)... " >&6; } if ${ax_cv_have_poll+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int rc; rc = poll((struct pollfd *)(0), 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ax_cv_have_poll=yes else ax_cv_have_poll=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test "${ax_cv_have_poll}" = "yes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ax_config_feature_poll=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ax_config_feature_poll=no fi # Check whether --enable-poll was given. if test "${enable_poll+set}" = set; then : enableval=$enable_poll; case "${enableval}" in yes) ax_config_feature_poll="yes" ;; no) ax_config_feature_poll="no" ;; *) as_fn_error $? "bad value ${enableval} for feature --poll" "$LINENO" 5 ;; esac fi if test "$ax_config_feature_poll" = yes; then : $as_echo "#define HAVE_POLL 1" >>confdefs.h if test "$ax_config_feature_verbose" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Feature poll is enabled" >&5 $as_echo "$as_me: Feature poll is enabled" >&6;} fi else if test "$ax_config_feature_verbose" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Feature poll is disabled" >&5 $as_echo "$as_me: Feature poll is disabled" >&6;} fi fi if test "$ax_cv_have_poll" != "yes" then # No poll(); try for select() instead. select_h=no for ac_header in sys/select.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" if test "x$ac_cv_header_sys_select_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SELECT_H 1 _ACEOF select_h=yes fi done # Some systems keep select() in a separate library which is not linked by # default. See if we need one of those. socklibok=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing select" >&5 $as_echo_n "checking for library containing select... " >&6; } if ${ac_cv_search_select+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char select (); int main () { return select (); ; return 0; } _ACEOF for ac_lib in '' socket nsl ws2_32 wsock32 winsock; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_select=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_select+:} false; then : break fi done if ${ac_cv_search_select+:} false; then : else ac_cv_search_select=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_select" >&5 $as_echo "$ac_cv_search_select" >&6; } ac_res=$ac_cv_search_select if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" socklibok=yes fi # Microsoft proprietary libraries do not work with code that is generated with # autoconf's SEARCH_LIBS macro, so we need to check manually and just use the # first socket library available. # We only do this if select() is not available by other means, to avoid picking # up an unnecessary Windows compatibility library on a non-Windows system. for l in ws2_32 wsock32 winsock do if test "${socklibok}" != "yes" then as_ac_Lib=`$as_echo "ac_cv_lib_$l''_main" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$l" >&5 $as_echo_n "checking for main in -l$l... " >&6; } if eval \${$as_ac_Lib+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$l $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$as_ac_Lib=yes" else eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : LIBS="$LIBS -l$l";socklibok=yes fi fi done if test "${socklibok}" != "yes" then as_fn_error $? " Could not figure out how to link a simple sockets-based program. Please read the config.log file for more clues as to why this failed. " "$LINENO" 5 fi fi # No poll() for ac_header in sys/time.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi done # Find PostgreSQL includes and libraries for ac_prog in pg_config do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PG_CONFIG="$PG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PG_CONFIG=$ac_cv_path_PG_CONFIG if test -n "$PG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PG_CONFIG" >&5 $as_echo "$PG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PG_CONFIG" && break done # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-postgres-include was given. if test "${with_postgres_include+set}" = set; then : withval=$with_postgres_include; if test "x$with_postgres_include" = "xyes"; then : with_postgres_include="" fi fi if test -n "$PG_CONFIG" && test -r "$PG_CONFIG"; then if test -z "$with_postgres_include"; then : with_postgres_include=$($PG_CONFIG --includedir) fi { $as_echo "$as_me:${as_lineno-$LINENO}: using PostgreSQL headers at $with_postgres_include" >&5 $as_echo "$as_me: using PostgreSQL headers at $with_postgres_include" >&6;} POSTGRES_INCLUDE="-I${with_postgres_include}" elif test -n "$PKG_CONFIG" && test -r "$PKG_CONFIG"; then if test -z "$with_postgres_include"; then : with_postgres_include=$($PKG_CONFIG libpq --cflags | sed 's/^-I//') fi { $as_echo "$as_me:${as_lineno-$LINENO}: using PostgreSQL headers at $with_postgres_include" >&5 $as_echo "$as_me: using PostgreSQL headers at $with_postgres_include" >&6;} POSTGRES_INCLUDE="-I${with_postgres_include}" else as_fn_error $? " Neither PostgreSQL configuration script pg_config nor pkg-config found. Make sure at least one of these is in your command path before configuring. Without either of them, the configure script has no way to find the right location for the libpq library and its headers. " "$LINENO" 5 fi # Check whether --with-postgres-lib was given. if test "${with_postgres_lib+set}" = set; then : withval=$with_postgres_lib; if test "x$with_postgres_lib" = "xyes"; then : with_postgres_lib="" fi fi if test -n "$PG_CONFIG" && test -r "$PG_CONFIG"; then if test -z "$with_postgres_lib"; then : with_postgres_lib=$($PG_CONFIG --libdir) fi { $as_echo "$as_me:${as_lineno-$LINENO}: using PostgreSQL libraries at $with_postgres_lib" >&5 $as_echo "$as_me: using PostgreSQL libraries at $with_postgres_lib" >&6;} #POSTGRES_LIB="-R${with_postgres_lib}" elif test -n "$PKG_CONFIG" && test -r "$PKG_CONFIG"; then if test -z "$with_postgres_lib"; then : with_postgres_lib=$($PKG_CONFIG libpq --libs-only-L | sed 's/^-L//') fi { $as_echo "$as_me:${as_lineno-$LINENO}: using PostgreSQL libraries at $with_postgres_lib" >&5 $as_echo "$as_me: using PostgreSQL libraries at $with_postgres_lib" >&6;} # configure insists on inserting a library search path, so give him a standard one ... with_postgres_lib="" #POSTGRES_LIB="-R${with_postgres_lib}" fi as_ac_Header=`$as_echo "ac_cv_header_${with_postgres_include}/libpq-fe.h" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "${with_postgres_include}/libpq-fe.h" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : else as_fn_error $? " Can't find libpq-fe.h in ${with_postgres_include}. Are you sure the libpq headers are installed correctly? They should be in the directory returned by \"pg_config --includedir\" or \"pkg-config libpq --cflags\". If you do have libpq (the C-language client library for PostgreSQL) installed, make sure you have the related development materials--mainly its header files-- as well as the library binary. Some system distributions keep the two in seperate packages with names like \"alibrary\" and \"alibrary-dev\", respectively. In that case, make sure you have the latter installed as well. " "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ability to compile source files using libpq" >&5 $as_echo_n "checking for ability to compile source files using libpq... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include<${with_postgres_include}/libpq-fe.h> int main () { PQexec(nullptr,"") ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else as_fn_error $? " Could not compile a call to a basic libpq function. There must be something seriously wrong with the headers that \"pg_config --includedir\" or \"pkg-config libpq --cflags\" pointed to; the contents of config.log may give you a clue about the nature of the failure. Source including the libpq header libpq-fe.h can be compiled, but a call to the most basic libpq function PQexec() failed to compile successfully. This is the litmus test for a working libpq. " "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } if test "x${with_postgres_lib}" = "x"; then with_postgres_libpath="" else with_postgres_libpath="-L${with_postgres_lib}" fi LDFLAGS="$LDFLAGS ${with_postgres_libpath}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PQexec in -lpq" >&5 $as_echo_n "checking for PQexec in -lpq... " >&6; } if ${ac_cv_lib_pq_PQexec+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpq ${with_postgres_libpath} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char PQexec (); int main () { return PQexec (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_pq_PQexec=yes else ac_cv_lib_pq_PQexec=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pq_PQexec" >&5 $as_echo "$ac_cv_lib_pq_PQexec" >&6; } if test "x$ac_cv_lib_pq_PQexec" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPQ 1 _ACEOF LIBS="-lpq $LIBS" else as_fn_error $? " Did not find the PQexec() function in libpq. This is the litmus test for a working libpq installation. A source file using the PQexec() function did compile without problems, and the libpq library is available for linking, but for some reason a call to PQexec() failed to link properly to the libpq library. This may be because the libpq library file is damaged, or in some incorrect format, or if your libpq is much more recent than libpqxx version $PQXX_ABI, perhaps libpq has undergone a radical ABI change. The last parts of config.log may give you a clue as to what really went wrong, but be warned that this is no easy reading. Look for the last error message occurring in the file. " "$LINENO" 5 fi # Remove redundant occurrances of -lpq LIBS=$(echo "$LIBS" | sed -e 's/-lpq * -lpq\>/-lpq/g') { $as_echo "$as_me:${as_lineno-$LINENO}: checking that type of libpq's Oid is as expected" >&5 $as_echo_n "checking that type of libpq's Oid is as expected... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include<${with_postgres_include}/libpq-fe.h> #include"${srcdir}/include/pqxx/internal/libpq-forward.hxx" extern void f(pqxx::oid&); int main () { Oid o;f(o) ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else as_fn_error $? " The Oid typedef in libpq has changed. Please notify the libpqxx authors of the change! " "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi ac_config_files="$ac_config_files Makefile config/Makefile doc/Makefile doc/Doxyfile src/Makefile test/Makefile test/unit/Makefile tools/Makefile win32/Makefile include/Makefile include/pqxx/Makefile libpqxx.pc" ac_config_commands="$ac_config_commands configitems" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_REFERENCE_TRUE}" && test -z "${BUILD_REFERENCE_FALSE}"; then as_fn_error $? "conditional \"BUILD_REFERENCE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_TUTORIAL_TRUE}" && test -z "${BUILD_TUTORIAL_FALSE}"; then as_fn_error $? "conditional \"BUILD_TUTORIAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libpqxx $as_me 6.4.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libpqxx config.status 6.4.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "include/pqxx/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/pqxx/config.h" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test/unit/Makefile") CONFIG_FILES="$CONFIG_FILES test/unit/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "win32/Makefile") CONFIG_FILES="$CONFIG_FILES win32/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/pqxx/Makefile") CONFIG_FILES="$CONFIG_FILES include/pqxx/Makefile" ;; "libpqxx.pc") CONFIG_FILES="$CONFIG_FILES libpqxx.pc" ;; "configitems") CONFIG_COMMANDS="$CONFIG_COMMANDS configitems" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "configitems":C) "${srcdir}/tools/splitconfig" "${srcdir}" ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi libpqxx-6.4.5/configure.ac000066400000000000000000000361011350065432700155110ustar00rootroot00000000000000# Generate configure script for libpqxx. This needs the autoconf archive # package installed. (The configure script itself does not require it though.) AC_PREREQ(2.69) AC_INIT( libpqxx, [m4_esyscmd_s([./tools/extract_version])], [Jeroen T. Vermeulen]) AC_LANG(C++) # Require C++11 at minimum. AX_CXX_COMPILE_STDCXX_11([noext]) AC_CONFIG_SRCDIR([src/connection.cxx]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([config/m4]) AM_INIT_AUTOMAKE PQXX_ABI=m4_esyscmd_s([./tools/extract_version --abi]) AC_SUBST(PQXXVERSION) AC_SUBST(PQXX_ABI) AC_CONFIG_HEADER([include/pqxx/config.h]) # Default prefix for installs. AC_PREFIX_DEFAULT(/usr/local) # Checks for programs. AC_PROG_CXX AC_PROG_INSTALL AC_DISABLE_SHARED AC_PROG_LIBTOOL AC_PROG_MAKE_SET AC_PATH_PROG([MKDIR], [mkdir]) # Documentation. AC_ARG_ENABLE( documentation, [AS_HELP_STRING([--enable-documentation], [Generate documentation])], [], [enable_documentation=auto]) AC_ARG_VAR([DOXYGEN], [Path to doxygen needed to build reference documentation]) AC_PATH_TOOL([DOXYGEN], [doxygen], [nodoxygen]) AC_ARG_VAR([HAVE_DOT], [Variable used by doxygen to declare availibility of dot]) AC_CHECK_TOOL([HAVE_DOT], [dot], [YES], [NO]) AC_ARG_VAR([XMLTO], [Path to xmlto needed to build tutorial documentation]) AC_PATH_TOOL([XMLTO], [xmlto], [noxmlto]) AS_IF([test "$enable_documentation" = "yes" && test "$DOXYGEN" = "nodoxygen" -o "$XMLTO" = "noxmlto"], [AC_MSG_ERROR([could not files tools necessary to build documentation])]) AM_CONDITIONAL([BUILD_REFERENCE], [test "$enable_documentation" != "no" -a "$DOXYGEN" != "nodoxygen"]) AM_CONDITIONAL([BUILD_TUTORIAL], [test "$enable_documentation" != "no" -a "$XMLTO" != "xmlto"]) AM_MAINTAINER_MODE # See if we want verbose compiler warnings. AC_MSG_CHECKING([maintainer mode]) AC_ARG_ENABLE(maintainer-mode) AC_MSG_RESULT(${enable_maintainer_mode}) # See if we want "audit," with loads of runtime checking. AC_MSG_CHECKING([audit]) AC_ARG_ENABLE(audit) AC_MSG_RESULT(${enable_audit}) AC_ARG_ENABLE(shared) AS_IF( [test "${shared}" = "yes" ], [CPPFLAGS="$CPPFLAGS -DPQXX_SHARED"]) # Add options to compiler command line, if compiler accepts them. add_compiler_opts_if_ok() { for option in $* do ACO_SAVE_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $option" AC_MSG_CHECKING([whether $CXX accepts $option]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([], [])], has_option=yes, has_option=no) AC_MSG_RESULT($has_option) AS_IF( [test "$has_option" = "no" ], [CXXFLAGS="$ACO_SAVE_CXXFLAGS"]) done } # Add options to compiler command line, unconditionally. add_compiler_opts() { CXXFLAGS="$CXXFLAGS $*" } # Let's try to get the compiler to be helpful. # # (Omit options -Weffc++ and -Wabi because they currently yield too many # warnings in gcc's standard headers; omit -Wunreachable-code because it isn't # always right) if test "$GCC" = "yes" then # In maintainer mode, enable all the warning options we can. if test "$enable_maintainer_mode" = "yes" then # "Eternal" (FLW) g++ options. These have been around for # ages, and both g++ and clang++ support them. Don't bother # checking for support; just add them to the compiler options. add_compiler_opts \ -fstrict-enums \ -Werror \ -Wall \ -pedantic \ -Wcast-align \ -Wcast-qual \ -Wconversion \ -Wctor-dtor-privacy \ -Wendif-labels \ -Wextra \ -Wfloat-equal \ -Wformat=2 \ -Wformat-security \ -Wmissing-include-dirs \ -Wno-div-by-zero \ -Wnon-virtual-dtor \ -Wold-style-cast \ -Woverlength-strings \ -Woverloaded-virtual \ -Wpointer-arith \ -Wredundant-decls \ -Wshadow \ -Wsign-promo \ -Wwrite-strings \ -Wundef \ -Wunused # "Iffy" g++ options. Some reasonably current g++-like # compilers may not support these. add_compiler_opts_if_ok \ -fnothrow-opt \ -Wattribute-alias \ -Wextra-semi \ -Wlogical-op \ -Wrestrict \ -Wstringop-overflow \ -Wsuggest-override \ -Wzero-as-null-pointer-constant fi # In "audit," enable all runtime checks we can. if test "$enable_audit" = "yes" then add_compiler_opts_if_ok \ -fsanitize=address \ -fsanitize=leak \ -fsanitize=undefined \ -fsanitize-address-use-after-scope \ -fstack-protector-all fi AC_MSG_CHECKING([g++ visibility attribute]) gcc_visibility=yes SAVE_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ struct __attribute__ ((visibility("hidden"))) d { d() {} void f() {} }; ]], [[d D; D.f()]] )], AC_DEFINE( [PQXX_HAVE_GCC_VISIBILITY], 1, [Define if g++ supports visibility attribute.]), gcc_visibility=no) AC_MSG_RESULT($gcc_visibility) CXXFLAGS="$SAVE_CXXFLAGS" if test "$gcc_visibility" = "yes" then # Make internal definitions accessible only to the library itself. # Only definitions marked PQXX_LIBEXPORT will be accessible. add_compiler_opts -fvisibility=hidden add_compiler_opts -fvisibility-inlines-hidden fi # Check gcc "const" attribute. (More like a stricter version of "pure"). AX_GCC_CONST_CALL if test "$ax_cv_gcc_const_call" then AC_DEFINE( [PQXX_HAVE_GCC_CONST], 1, [Define if g++ supports const attribute.]) fi if test "$deprecated" != "yes" then AC_MSG_CHECKING([g++ deprecation attribute]) gcc_deprecated=yes AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[__attribute__ ((deprecated)) void f();]], [] )], AC_DEFINE( [PQXX_HAVE_GCC_DEPRECATED], 1, [Define if g++ supports deprecated attribute.]), gcc_deprecated=no) AC_MSG_RESULT($gcc_deprecated) fi AC_MSG_CHECKING([g++ pure attribute]) gcc_pure=yes AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([void __attribute__ ((pure)) f();], [])], AC_DEFINE( [PQXX_HAVE_GCC_PURE], 1, [Define if g++ supports pure attribute]), gcc_pure=yes) AC_MSG_RESULT($gcc_pure) fi # End of gcc-specific part. AC_MSG_CHECKING([C++14 deprecation attribute]) deprecated=yes AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[/* */ [[deprecated]] void f(); ]], [])], AC_DEFINE( [PQXX_HAVE_DEPRECATED], 1, [Define if compiler supports [[deprecated]] attribute]), deprecated=no) AC_MSG_RESULT($deprecated) AC_MSG_CHECKING([for C++17 std::optional support]) have_optional=yes AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [return std::optional(0).value()] )], AC_DEFINE( [PQXX_HAVE_OPTIONAL], 1, [Define if the compiler supports std::optional.]), have_optional=no) AC_MSG_RESULT($have_optional) if test "$have_optional" != "yes" then AC_MSG_CHECKING([for experimental C++17 std::optional support]) have_exp_optional=yes AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [#include ], [return std::experimental::optional(0).value()] )], AC_DEFINE( [PQXX_HAVE_EXP_OPTIONAL], 1, [Define if the compiler supports std::experimental::optional.]), have_exp_optional=no) AC_MSG_RESULT($have_exp_optional) fi # It's early 2019, and gcc's charconv supports integers but not yet floats. # So for now, we test for int and float conversion... separately. # # It's worse for clang, which compiles the integer conversions but then fails # at link time because of a missing symbol "__muloti4" when compiling # "long long" code. I couldn't resolve that symbol by adding -lm either. So # don't just compile these tests; link them as well. AC_MSG_CHECKING([for C++17 charconv integer conversion]) have_charconv_int=yes AC_LINK_IFELSE( [AC_LANG_PROGRAM( [#include ], [[ char z[100]; using ull = unsigned long long; auto rt = std::to_chars(z, z + sizeof(z), ull{0}); if (rt.ec != std::errc{}) return 1; ull n; auto rf = std::from_chars(z, z + sizeof(z), n); if (rf.ec != std::errc{}) return 2; return int(n) ]] )], AC_DEFINE( [PQXX_HAVE_CHARCONV_INT], 1, [Define if supports integer conversion.]), have_charconv_int=no) AC_MSG_RESULT($have_charconv_int) AC_MSG_CHECKING([for C++17 charconv floating-point conversion]) have_charconv_float=yes AC_LINK_IFELSE( [AC_LANG_PROGRAM( [#include ], [[ char z[100]; using ld = long double; auto rt = std::to_chars( z, z + sizeof(z), ld{0.1}, std::chars_format::generic); if (rt.ec != std::errc{}) return 1; ld n; auto rf = std::from_chars(z, z + sizeof(z), n); if (rf.ec != std::errc{}) return 2; return int(n) ]] )], AC_DEFINE( [PQXX_HAVE_CHARCONV_FLOAT], 1, [Define if supports floating-point conversion.]), have_charconv_float=no) AC_MSG_RESULT($have_charconv_float) AX_HAVE_POLL( [AX_CONFIG_FEATURE_ENABLE(poll)], [AX_CONFIG_FEATURE_DISABLE(poll)]) AX_CONFIG_FEATURE( [poll], [System supports poll().], [HAVE_POLL], [System supports poll().]) if test "$ax_cv_have_poll" != "yes" then # No poll(); try for select() instead. select_h=no AC_CHECK_HEADERS([sys/select.h], [select_h=yes]) # Some systems keep select() in a separate library which is not linked by # default. See if we need one of those. socklibok=no AC_SEARCH_LIBS(select, socket nsl ws2_32 wsock32 winsock, [socklibok=yes]) # Microsoft proprietary libraries do not work with code that is generated with # autoconf's SEARCH_LIBS macro, so we need to check manually and just use the # first socket library available. # We only do this if select() is not available by other means, to avoid picking # up an unnecessary Windows compatibility library on a non-Windows system. for l in ws2_32 wsock32 winsock do if test "${socklibok}" != "yes" then AC_CHECK_LIB($l,main,LIBS="$LIBS -l$l";[socklibok=yes]) fi done if test "${socklibok}" != "yes" then AC_MSG_ERROR([ Could not figure out how to link a simple sockets-based program. Please read the config.log file for more clues as to why this failed. ]) fi fi # No poll() AC_CHECK_HEADERS([sys/time.h]) # Find PostgreSQL includes and libraries AC_PATH_PROGS(PG_CONFIG, pg_config) AC_PATH_PROG([PKG_CONFIG], [pkg-config]) AC_ARG_WITH( [postgres-include], [AS_HELP_STRING( [--with-postgres-include=DIR], [Use PostgreSQL includes from DIR. Defaults to querying pg_config or pkg-config, whichever is available.])], AS_IF( [test "x$with_postgres_include" = "xyes"], [with_postgres_include=""])) if test -n "$PG_CONFIG" && test -r "$PG_CONFIG"; then AS_IF( [test -z "$with_postgres_include"], [with_postgres_include=$($PG_CONFIG --includedir)]) AC_MSG_NOTICE([using PostgreSQL headers at $with_postgres_include]) AC_SUBST(with_postgres_include) POSTGRES_INCLUDE="-I${with_postgres_include}" AC_SUBST(POSTGRES_INCLUDE) elif test -n "$PKG_CONFIG" && test -r "$PKG_CONFIG"; then AS_IF( [test -z "$with_postgres_include"], [with_postgres_include=$($PKG_CONFIG libpq --cflags | sed 's/^-I//')]) AC_MSG_NOTICE([using PostgreSQL headers at $with_postgres_include]) AC_SUBST(with_postgres_include) POSTGRES_INCLUDE="-I${with_postgres_include}" AC_SUBST(POSTGRES_INCLUDE) else AC_MSG_ERROR([ Neither PostgreSQL configuration script pg_config nor pkg-config found. Make sure at least one of these is in your command path before configuring. Without either of them, the configure script has no way to find the right location for the libpq library and its headers. ]) fi AC_ARG_WITH( [postgres-lib], [AS_HELP_STRING( [--with-postgres-lib=DIR], [Use PostgreSQL libraries from DIR. Defaults to querying pg_config.])], AS_IF( [test "x$with_postgres_lib" = "xyes"], [with_postgres_lib=""])) if test -n "$PG_CONFIG" && test -r "$PG_CONFIG"; then AS_IF( [test -z "$with_postgres_lib"], [with_postgres_lib=$($PG_CONFIG --libdir)]) AC_MSG_NOTICE([using PostgreSQL libraries at $with_postgres_lib]) AC_SUBST(with_postgres_lib) #POSTGRES_LIB="-R${with_postgres_lib}" AC_SUBST(POSTGRES_LIB) elif test -n "$PKG_CONFIG" && test -r "$PKG_CONFIG"; then AS_IF( [test -z "$with_postgres_lib"], [with_postgres_lib=$($PKG_CONFIG libpq --libs-only-L | sed 's/^-L//')]) AC_MSG_NOTICE([using PostgreSQL libraries at $with_postgres_lib]) # configure insists on inserting a library search path, so give him a standard one ... AC_SUBST(with_postgres_lib, "") #POSTGRES_LIB="-R${with_postgres_lib}" AC_SUBST(POSTGRES_LIB) fi AC_CHECK_HEADER( [${with_postgres_include}/libpq-fe.h], [], [AC_MSG_ERROR([ Can't find libpq-fe.h in ${with_postgres_include}. Are you sure the libpq headers are installed correctly? They should be in the directory returned by "pg_config --includedir" or "pkg-config libpq --cflags". If you do have libpq (the C-language client library for PostgreSQL) installed, make sure you have the related development materials--mainly its header files-- as well as the library binary. Some system distributions keep the two in seperate packages with names like "alibrary" and "alibrary-dev", respectively. In that case, make sure you have the latter installed as well. ])]) AC_MSG_CHECKING([for ability to compile source files using libpq]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include<${with_postgres_include}/libpq-fe.h>]], [[PQexec(nullptr,"")]] )], [], [AC_MSG_ERROR([ Could not compile a call to a basic libpq function. There must be something seriously wrong with the headers that "pg_config --includedir" or "pkg-config libpq --cflags" pointed to; the contents of config.log may give you a clue about the nature of the failure. Source including the libpq header libpq-fe.h can be compiled, but a call to the most basic libpq function PQexec() failed to compile successfully. This is the litmus test for a working libpq. ])]) AC_MSG_RESULT(yes) if test "x${with_postgres_lib}" = "x"; then with_postgres_libpath="" else with_postgres_libpath="-L${with_postgres_lib}" fi LDFLAGS="$LDFLAGS ${with_postgres_libpath}" AC_CHECK_LIB( [pq], [PQexec], [], [AC_MSG_ERROR([ Did not find the PQexec() function in libpq. This is the litmus test for a working libpq installation. A source file using the PQexec() function did compile without problems, and the libpq library is available for linking, but for some reason a call to PQexec() failed to link properly to the libpq library. This may be because the libpq library file is damaged, or in some incorrect format, or if your libpq is much more recent than libpqxx version $PQXX_ABI, perhaps libpq has undergone a radical ABI change. The last parts of config.log may give you a clue as to what really went wrong, but be warned that this is no easy reading. Look for the last error message occurring in the file. ])], ${with_postgres_libpath}) # Remove redundant occurrances of -lpq LIBS=[$(echo "$LIBS" | sed -e 's/-lpq * -lpq\>/-lpq/g')] AC_MSG_CHECKING([that type of libpq's Oid is as expected]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [ #include<${with_postgres_include}/libpq-fe.h> #include"${srcdir}/include/pqxx/internal/libpq-forward.hxx" extern void f(pqxx::oid&); ], [Oid o;f(o)], )], [], [AC_MSG_ERROR([ The Oid typedef in libpq has changed. Please notify the libpqxx authors of the change! ])]) AC_MSG_RESULT(yes) AC_PROG_MAKE_SET AC_CONFIG_FILES([ Makefile config/Makefile doc/Makefile doc/Doxyfile src/Makefile test/Makefile test/unit/Makefile tools/Makefile win32/Makefile include/Makefile include/pqxx/Makefile libpqxx.pc]) AC_CONFIG_COMMANDS([configitems], ["${srcdir}/tools/splitconfig" "${srcdir}"]) AC_OUTPUT libpqxx-6.4.5/doc/000077500000000000000000000000001350065432700137675ustar00rootroot00000000000000libpqxx-6.4.5/doc/Doxyfile.in000066400000000000000000001523421350065432700161110ustar00rootroot00000000000000# Doxyfile 1.5.5 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = libpqxx # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @PQXXVERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = html/Reference # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, # and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = ../ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = YES # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = NO # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = NO # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = NO # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = @top_srcdir@/include/pqxx \ @top_srcdir@/include/pqxx/doc \ @top_srcdir@/src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.cxx \ *.hxx \ *.h \ *.md # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = *.o \ *.lo \ *.a \ .cvsignore # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = . # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = YES # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = YES # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = YES # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = include # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = *.h *.hxx # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = PQXX_ABI="@PQXX_ABI@" \ PQXX_DEPRECATED= \ PQXX_LIBEXPORT= \ PQXX_NOVTABLE= \ PQXX_PRIVATE= \ PQXX_TYPENAME=typename \ PQXX_VERSION="@PQXXVERSION@" \ PQXX_MAJOR=@PQXX_MAJOR@ \ PQXX_MINOR=@PQXX_MINOR@ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = @HAVE_DOT@ # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = NO # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is enabled by default, which results in a transparent # background. Warning: Depending on the platform used, enabling this option # may lead to badly anti-aliased labels on the edges of a graph (i.e. they # become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO libpqxx-6.4.5/doc/Makefile.am000066400000000000000000000042531350065432700160270ustar00rootroot00000000000000MAINTAINERCLEANFILES = Makefile.in maintainer-clean-local: $(RM) -rf html/Reference html/Tutorial $(RM) reference-stamp tutorial-stamp $(MKDIR) html/Reference html/Tutorial EXTRA_DIST= Doxyfile.in libpqxx.xml reference-stamp tutorial-stamp all-local: docs if BUILD_REFERENCE REFERENCE_DOCS = reference else REFERENCE_DOCS = endif if BUILD_TUTORIAL TUTORIAL_DOCS = tutorial else TUTORIAL_DOCS = endif if MAINTAINER_MODE REFERENCE_STAMP_DEPENDENCIES = ../src/libpqxx.la else REFERENCE_STAMP_DEPENDENCIES = endif DOCS = $(REFERENCE_DOCS) $(TUTORIAL_DOCS) docs: $(DOCS) reference: reference-stamp reference-stamp: Doxyfile.in $(REFERENCE_STAMP_DEPENDENCIES) if test -x "$(DOXYGEN)"; then \ $(MKDIR_P) html/Reference; \ $(DOXYGEN) Doxyfile; \ touch $@; \ else \ echo >&2; \ echo >&2 "*****************************************************"; \ echo >&2; \ echo >&2 "Doxygen not found."; \ echo >&2 "Install it, or configure with --disable-documentation"; \ echo >&2; \ echo >&2 "*****************************************************"; \ exit 1; \ fi ../src/libpqxx.la: cd ../src; \ $(MAKE) libpqxx.la tutorial: tutorial-stamp tutorial-stamp: libpqxx.xml if test -x "$(XMLTO)"; then \ $(XMLTO) -o html/Tutorial xhtml $<; \ touch $@; \ else \ echo >&2; \ echo >&2 "*****************************************************"; \ echo >&2; \ echo >&2 "xmlto not found."; \ echo >&2 "Install it, or configure with --disable-documentation"; \ echo >&2; \ echo >&2 "*****************************************************"; \ exit 1; \ fi DISTHOOKDIRS = html/Reference html/Tutorial dist-hook: reference tutorial mkdir $(distdir)/html # Do a shallow copy of each directory for dir in $(DISTHOOKDIRS); do \ if test -d $(srcdir)/$$dir; then \ mkdir $(distdir)/$$dir; \ for dirfile in $(srcdir)/$$dir/*; do \ if test -f $$dirfile; then \ cp -p $$dirfile $(distdir)/$$dir; \ fi ; \ if test -d $$dirfile ; then \ subdir="`basename "$$dirfile"`"; \ if test "$$subdir" != "CVS" && "$$subdir" != ".svn" ; then \ cp -pR $$dirfile $(distdir)/$$dir; \ fi \ fi \ done \ fi \ done libpqxx-6.4.5/doc/Makefile.in000066400000000000000000000355701350065432700160460ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = Doxyfile CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.in \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = Doxyfile.in libpqxx.xml reference-stamp tutorial-stamp @BUILD_REFERENCE_FALSE@REFERENCE_DOCS = @BUILD_REFERENCE_TRUE@REFERENCE_DOCS = reference @BUILD_TUTORIAL_FALSE@TUTORIAL_DOCS = @BUILD_TUTORIAL_TRUE@TUTORIAL_DOCS = tutorial @MAINTAINER_MODE_FALSE@REFERENCE_STAMP_DEPENDENCIES = @MAINTAINER_MODE_TRUE@REFERENCE_STAMP_DEPENDENCIES = ../src/libpqxx.la DOCS = $(REFERENCE_DOCS) $(TUTORIAL_DOCS) DISTHOOKDIRS = html/Reference html/Tutorial all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool cscopelist-am ctags-am dist-hook distclean \ distclean-generic distclean-libtool distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile maintainer-clean-local: $(RM) -rf html/Reference html/Tutorial $(RM) reference-stamp tutorial-stamp $(MKDIR) html/Reference html/Tutorial all-local: docs docs: $(DOCS) reference: reference-stamp reference-stamp: Doxyfile.in $(REFERENCE_STAMP_DEPENDENCIES) if test -x "$(DOXYGEN)"; then \ $(MKDIR_P) html/Reference; \ $(DOXYGEN) Doxyfile; \ touch $@; \ else \ echo >&2; \ echo >&2 "*****************************************************"; \ echo >&2; \ echo >&2 "Doxygen not found."; \ echo >&2 "Install it, or configure with --disable-documentation"; \ echo >&2; \ echo >&2 "*****************************************************"; \ exit 1; \ fi ../src/libpqxx.la: cd ../src; \ $(MAKE) libpqxx.la tutorial: tutorial-stamp tutorial-stamp: libpqxx.xml if test -x "$(XMLTO)"; then \ $(XMLTO) -o html/Tutorial xhtml $<; \ touch $@; \ else \ echo >&2; \ echo >&2 "*****************************************************"; \ echo >&2; \ echo >&2 "xmlto not found."; \ echo >&2 "Install it, or configure with --disable-documentation"; \ echo >&2; \ echo >&2 "*****************************************************"; \ exit 1; \ fi dist-hook: reference tutorial mkdir $(distdir)/html # Do a shallow copy of each directory for dir in $(DISTHOOKDIRS); do \ if test -d $(srcdir)/$$dir; then \ mkdir $(distdir)/$$dir; \ for dirfile in $(srcdir)/$$dir/*; do \ if test -f $$dirfile; then \ cp -p $$dirfile $(distdir)/$$dir; \ fi ; \ if test -d $$dirfile ; then \ subdir="`basename "$$dirfile"`"; \ if test "$$subdir" != "CVS" && "$$subdir" != ".svn" ; then \ cp -pR $$dirfile $(distdir)/$$dir; \ fi \ fi \ done \ fi \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/doc/conf.py000066400000000000000000000134721350065432700152750ustar00rootroot00000000000000# -*- coding: utf-8 -*- """ libpqxx documentation build configuration file, created by sphinx-quickstart on Sun Dec 3 00:43:33 2017. This file is execfile()d with the current directory set to its containing dir. All configuration values have a default; values that are commented out serve to show the default. """ import codecs import os import subprocess # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import sys # sys.path.insert(0, os.path.abspath(os.path.curdir)) read_the_docs_build = os.environ.get('READTHEDOCS') == 'True' if read_the_docs_build: subprocess.check_call( os.path.join(os.path.curdir, 'configure'), cwd=os.path.pardir) subprocess.check_call('doxygen', cwd=os.path.join(os.path.pardir, 'doc')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = u'libpqxx' copyright = u'2000-2019, Jeroen T. Vermeulen' author = u'Jeroen T. Vermeulen' def read_version(): """Return version number as specified in the VERSION file.""" version_file = os.path.join( os.path.dirname(__file__), os.path.pardir, 'VERSION') with codecs.open(version_file, encoding='ascii') as stream: return stream.read().strip() # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The full version, including alpha/beta/rc tags. release = read_version() # The short X.Y version. version = release # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # This is required for the alabaster theme # refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars html_sidebars = { '**': [ 'relations.html', # needs 'show_related': True theme option to display 'searchbox.html', ] } # Looks like the setup is that our build generates the HTML itself, and then # has readthedocs copy the full generated HTML tree to the output directory. # # Problem is, that doesn't seem to be working now. This needs debugging. html_extra_path = ["html/Reference"] # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'libpqxxdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ( master_doc, 'libpqxx.tex', u'libpqxx Documentation', u'Jeroen T. Vermeulen', 'manual', ), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'libpqxx', u'libpqxx Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'libpqxx', u'libpqxx Documentation', author, 'libpqxx', "C++ client API for PostgreSQL.", 'Miscellaneous'), ] libpqxx-6.4.5/doc/html/000077500000000000000000000000001350065432700147335ustar00rootroot00000000000000libpqxx-6.4.5/doc/html/README.md000066400000000000000000000001131350065432700162050ustar00rootroot00000000000000HTML docs ========= HTML documentation is generated in these directories. libpqxx-6.4.5/doc/index.rst000066400000000000000000000006431350065432700156330ustar00rootroot00000000000000.. x documentation master file, created by sphinx-quickstart on Sun Dec 3 01:30:12 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to x's documentation! ============================= .. toctree:: :maxdepth: 2 :caption: Contents: Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` libpqxx-6.4.5/doc/libpqxx.xml000066400000000000000000001267721350065432700162170ustar00rootroot00000000000000 libpqxx tutorial Jeroen T. Vermeulen 2002—2017 Jeroen T. Vermeulen About libpqxx libpqxx is a C++ API for PostgreSQL. Since libpqxx builds on top of the C frontend libpq, you will need a working libpq library on your system prior to getting started with libpqxx. This is similar to the situation with the older libpq++ interface. See the Github page for more information. Class overview To work with libpqxx, you need to be aware of at least the following classes. These are all introduced in a dedicated namespace, pqxx: connection represents a connection from your program to a PostgreSQL back-end server. Naturally your program may open multiple connections, simultaneous or not, to any number of databases. work, actually an alias for the transaction class template, represents a transaction being executed in the context of a connection. This is a unit of work that must be completed as a whole by the database backend. If execution fails, everything done within that transaction is undone by the backend as if it had never happened. Actually libpqxx provides three classes doing this at various levels of reliability, called nontransaction, transaction, and robusttransaction for no, standard, and best reliability respectively. You probably shouldn't mess with robusttransaction though, because it comes with complications. You may execute any number of transactions on a single connection, but only one at a time. I recommend that you do not set up your own transactions, but have them managed for you by a transactor instead (see below). A result is a container holding the resulting data coming out of a query or command executed in a transaction. It behaves just like a standard C++ container as found in the STL, although its contents can't be modified in any way. (You can assign or copy it cheaply though; it's basically a smart pointer). The rows held in the result in turn behave much like non-modifiable containers themselves. I would also like to use this opportunity to plug the esc function, which you should use whenever you want to include a variable as a string in your SQL (eg. insert it into a text field in a table). See below. There are other classes that may be of interest to you, but which you don't necessarily need to be aware of for writing programs. You will probably want to look them up at some point when it becomes necessary to figure out complex compiler warnings. Some of the classes you may become interested in fairly quickly are: broken_connection is an exception class that is thrown if libpqxx loses its connection to the back-end. It is derived from the standard C++ exception std::runtime_error, and can generally be treated as such. sql_error is an exception class that is thrown if a query to the back-end fails. Like broken_connection it is derived from std::runtime_error, but it also carries information about the failed query. This may be useful for debugging. icursorstream is a way of iterating over a query result using an SQL cursor. This can be useful for selectively retrieving parts of a query, or for retrieving and processing results in chunks so your program can do useful work on one chunk while the next is still coming in over a network connection. Or you may want to use this to give progress reports to the user between chunk transfers. in_doubt_error is an exception class to indicate a rare and difficult error condition. Explaining this is a bit painful, since it invalidates some of what was said above (and is commonly said in the database world). In theory, a "transaction" is an integral, atomic unit of work that either fails or succeeds. This is a beautiful idea, but in practice there is nothing that cannot be broken. There is a tiny risk that, like Schroedinger's Cat, the transaction can end up in an indeterminate state. This happens when the connection to the backend is lost just when you were waiting for confirmation after completing your transaction. Your transaction may have succeeded (in fact it probably has), but if the connection is lost during just this small time window, there is no way to confirm this to your application. When this happens, libpqxx throws an in_doubt_error on the client side, which you may want to catch as a special case. If you do, make sure all alarm bells go off! See also the description for robusttransaction, which sacrifices some performance to minimize this risk. nontransaction is just like a regular transaction as far your code is concerned (except that it's not a template). The big difference is that where the latter opens a back-end transaction to keep your view and modifications of the database atomic, the former does nothing to maintain integrity. It just passes your queries directly to the database, with no enclosing transaction. This difference is expressed by the fact that the other transaction classes are derived from dbtransaction, an abstract class that expresses the presence of a real backend transaction, whereas nontransaction is not. This may give you better performance if your transaction does not modify the database, but if it does, may have unforeseen implications if you expect certain levels of consistency in the database--especially if other processes or threads may be modifying the database at the same time. You'll probably only want to use this in the following cases: If you only want to read from the database, not modify it, and you know that the data is not going to be updated while your program is running. If you are interested in always getting the very latest information out of your database, even if that means that you may not get a temporally consistent view of the database. When making changes to the database schema; some operations may not be supported by the backend inside backend transactions. robusttransaction (a template just like transaction) is essentially the same as a transaction, ie. an atomic unit of work, except that it works harder to prevent in_doubt_errors from happening. This comes at the cost of some performance, which is one reason why this behaviour isn't the default. It also creates some extra tables in your database to keep track of what's happening. Use this class instead of plain old transaction if you get in_doubt_errors in your application--but only after thoroughly inspecting your code for bugs that might be causing the problem, or you'll only be hiding glitches that should be fixed instead. transaction_base defines the common public interface for the transaction-like classes: nontransaction, robusttransaction, and transaction itself. To look up methods available in these classes, see the definition (or documentation) for transaction_base instead. You'll usually want to refer to the default transaction type as work, an alias that means "transaction with default (read-committed) isolation level." transactor<> provides a framework that makes it easier for you to write correct, robust transaction code to be executed in a transaction. You should generally try to write your code as a class derived from transactor<>, but this is not required. A transactor-derived class may select its own "quality of service" in transactional integrity by choosing a transaction type as its template argument, e.g. transactor<robusttransaction<> >. The default transactor<> is equivalent to transactor<work>. Within your class you can refer to the transaction type used as argument_type. notification_receiver is an instance of the Observer design pattern. Any code connected to a backend may flag an event using the PostgreSQL NOTIFY command. Frontends connected to that same backend database may be listening for an event of that name to occur. A frontend using libpqxx does this by registering an observer object derived from notification_receiver, which will be invoked by libpqxx to handle the event when it occurs. Something every programmer using notification receivers in PostgreSQL should know, by the way, is that notifications are not delivered to your program while it is inside a back-end transaction. Nor are they sent until the notifying process has committed any transaction it may be in. This makes sense from a correctness point of view (otherwise your processing of the event might get rolled back just because the transaction you're in happens to fail), but may be a little confusing to the unaware programmer. row refers to a row of data within a result object. field refers to one field within a row. A field contains one retrieved value such as a number or a string, and can be read into variables of various types such as ints or strings. result::const_iterator allows you to enumerate the rows in a result in a similar way to the iterators defined by any standard C++ container. result::row::const_iterator similarly iterates over the fields in a row. Finally, there are also some functions that you may want to know about, that live alone in the pqxx namespace without being part of any class: esc, found in the transaction classes, is the canonical way to use strings in your SQL. This function escapes any quotes, backslashes, and other characters in your input string that would otherwise cause syntax errors (or worse, security holes) in your queries when included directly. Use these functions whenever you want to have a variable string in your SQL queries. If you don't, you'll be left with annoying bugs or possibly even security holes in your program. Use this function, use this function, use this function. Please. Make me proud. to_string knows how to render many types of values as strings. This is used internally by libpqxx to convert values coming out of or going into the backend, and doesn't respect locale settings. from_string is the inverse of to_string. It is used by eg. field::to() to convert the incoming field data (which is in text format) to the desired C++ type. Tutorial
Before we begin programming
This document This frontend library is built on top of the libpq frontend library, which defines PostgreSQL's C API. Therefore this manual will sometimes refer to the libpq documentation rather than repeat what is said there. This was not done to annoy you, but to ensure that the libpqxx documentation remains up-to-date with any changes in the C frontend. Please bear with us. Furthermore, if you're ever in doubt about how to use the basic features of libpqxx, take a look at the example programs provided; they're called test000, test001 etc. Those should help give you an idea of how simple the library can be in practice. Don't let that keep you from submitting a request for improved documentation though; your questions define what this tutorial needs to say!
C++ conventions All definitions made by libpqxx reside in a namespace pqxx. If you're not familiar with C++ namespaces, you have two options: Always import the whole of the pqxx namespace in your programs. This tells the compiler to always look in the pqxx namespace when trying to resolve a name that doesn't occur in the global (ie. the "default") namespace). To do this, include the directive using namespace pqxx; near the top of each source file that uses libpqxx. This is typically best for your source files (you're probably doing it already for the std namespace), though it is not considered good practice in header files. Explicitly qualify each libpqxx name with the pqxx namespace. This will tell the compiler exactly which names are supposed to be in the pqxx namespace, avoiding any confusion over multiple classes or functions used in your program possibly having the same name. As long as they're in different namespaces, the compiler will be able to tell them apart without trouble. To do this, write pqxx::connection instead of connection, pqxx::result::const_iterator instead of result::const_iterator, and so on. This is the mode of address you will typically want to use in header files, to avoid polluting the namespaces of the actual source files with the definitions of the extra namespace.
Setting up a connection The very first thing to do before we can begin working with a database, is actually connect to one. We do this by creating a connection object that will serve as our "handle" on the connection: connection Conn("dbname=test"); This gives us a connection object called Conn. The connection constructor here takes one argument, the "connect string." This string may be used to specify which host on the network runs the database backend we wish to connect to, which database we're interested in, which user name we'll be using to log in, etc. Refer to the libpq connect call for a complete definition of what may go into the connect string. In this case we're connecting to a database test residing on the local machine. By default the client will try to connect to a server running on the local machine. If no connection could be established, the connection constructor may throw an exception immediately; or it may decide to retry the connection later in case the problem is only temporary. In the latter case, an exception may occur at some later point if the problem turns out not to be so temporary after all. The connection can now act as a "service counter" for our database; your client will use it to perform one or more transactions related to the database. Connections cannot be copied or assigned. Any attempt to do so will be met with a compiler error. As a matter of design, libpqxx will not allow you to perform queries on the connection directly. You will need to open a transaction instead. See the section on transactions below.
Performing a transaction
What's a Transaction? A transaction demarcates a "unit of work" operating on the database, ie. a series of operations that must either complete successfully, or if it is aborted at any stage, must not affect the data in the database at all. Hence the process of completing a transaction is called the "commit" operation, and the process of aborting it and undoing any changes it may have made is called "rollback." All access to the database in libpqxx must go through a transaction object, so familiarity with this class family's interface is essential.
Creating a transaction object Creating a transaction object is not normally something you will have to do. The transactor class, discussed below, will take care of that and some other red tape besides. Still, there are cases where creating the object is unavoidable (when acting on multiple database connections simultaneously) or just plain easier to do. Please consider using a transactor whereever possible. When creating a transaction, pass it the connection object it is to act on, and optionally an identifying name for your transaction. The name, which need not be unique but should begin with a letter and may contain only letters, digits and underscores, can be used by libpqxx to make some error messages more specific. transaction<> Xaction(Conn, "DemoTransaction"); Or, alternatively (once you get fed up with typing transaction<>): work Xaction(Conn, "DemoTransaction"); The lifetime of the transaction object demarcates the unit of work. Its construction marks the beginning of the transaction, and its destruction means that the transaction is ended--whether through commit or rollback. The transaction class hierarchy is built on the principle of "explicit commit," ie. the commit operation must always be explicit in the code. If the transaction is destroyed before a commit was given, the transaction is implicitly aborted (rolled back). If your transaction makes no changes to the database, however, there is nothing to commit or roll back and the commit may safely be omitted. Destroying the connection object while the transaction still exists is an error that may result in a program crash, although the library will try to log an error message. Transactions cannot be copied, nor assigned, nor constructed without a connection (default-constructed); attempts to do any of these will result in compile errors.
Ending a transaction A transaction ends either successfully through an explicit commit command, or unsuccessfully in any of a number of ways. The following are the ways to end a transaction: The transaction may be committed through its commit member function: Xaction.commit(); The commit operation is sent to the backend at the point where the commit call occurs. Any exceptions generated by the database transaction will be thrown from here at the latest. The only exceptions that may be generated by Xaction beyond this point are related to incorrect handling of the transaction object, eg. if an attempt is made to abort Xaction after it has been committed, or runtime errors such as memory running out. As a consequence, any streams or cursors nested within the transaction (to be discussed later) must have been closed before the commit(). To do otherwise could possibly allow a transaction to be committed before all related actions had completed. The library will throw an exception if any streams are still open when the transaction is ended. A transaction is aborted if it is destroyed without having been explicitly committed: { work Xaction(Conn, "DemoTransaction"); // (Queries) } // Xaction destroyed here work *XactionP = new work(Conn, "DemoTransaction"); // (Queries) delete XactionP; // Xaction destroyed here try { work Xaction(Conn, "DemoTransaction"); // (Queries) Xaction.commit(); // If we get here, Xaction is committed } catch (...) { // If we get here, Xaction has been rolled back } No matter where exactly the decision to abort is made, the actual abort operation is sent to the backend when the transaction's destructor is called. If the abort fails, eg. because the network connection has been lost, no error is reported Throwing an exception from a destructor to report the error would have serious effects on program correctness. Never throw exceptions from a destructor. and the transaction will die of natural causes (either it has been closed by the backend already, or it soon will be if the connection is lost). If a database error occurs during the transaction, such as an SQL syntax error or lost connection to the backend, the transaction is aborted. work Xaction(Conn, "DemoTransaction"); try { // (Queries) Xaction.exec("SELECT !?^H^H^H^H"); // Fails: SQL syntax error } catch (...) { } Xaction.commit(); // ERROR: Xaction has already aborted! For this reason, it is recommended always to include the "commit" operation inside the try block (if any) surrounding the transaction code, not after the catch block. Think of it as a natural extension of structural programming: the transaction is "nested" within the connection, and the transaction code can be "nested" in a try/catch block. No more queries may be issued to the transaction regardless of how it ended; an exception will be thrown if the application attempts to continue the transaction after that time. Ending a transaction more than once is an error, except that aborting it multiple times is tolerated to facilitate error handling.
Executing queries So let's execute an actual query. There is no "query class" in libpqxx; we really do try to keep your life simple. A query is executed within a transaction by passing the query string to the transaction object's exec method. If the query fails to complete successfully, this method will throw the appropriate exception. The query itself is a standard C string in this case, ie. a const char * but you'll frequently want to use a C++ string to make it easy to include variables: void DeleteEntry(work &T, string Table, long ID) { T.exec("DELETE FROM " + Table + " WHERE ID=" + to_string(ID)); } In some places, even stringstreams will work, so you can use the full stream formatting capabilities, locales etc. in the standard C++ library to compose your SQL queries.
Getting query results Obviously not all queries are commands--the more common kind actually returns useful data. Result data in libpqxx are encapsulated in a result object, which acts as a container similar to the STL's vector template. result R = T.exec("SELECT firstname FROM employee WHERE lastname='Ng'"); This executes a query on the database, collects all matching data, and stores it in the form of a result. Two ways are provided to get at individual rows in a result: first, through indexing with the array index operator [] or the at member function, and second, through random-access iterators. Either will give you a row object that in turn can be addressed with the array index operator (or the at member function) or using iterators to get at its individual fields The difference between [] and at is that the latter is guaranteed to perform bounds-checking, throwing an exception if you pass it an illegal index value. With the array index operator you may get slightly better performance, but attempting to address a nonexistent row or field will result in undefined behaviour such as program crashes or inexplicably strange results. . Thus, R[0] will return the first ("zeroth") row in R. You won't normally want to bother with rows though; they don't contain the actual data, but rather serve as placeholders to later tell result which fields to fetch when field values from the row are requested. The class exists mostly for technical reasons related to the array index operators This is an instance of the Proxy implementation pattern, needed to allow a result to be indexed as if it were a two-dimensional array. C++'s array index operator doesn't allow this usage directly, but the operator can be applied to the result of a previous use of the same operator. The "result in the middle" needs to have a type of its own, though, and that's what row is for. . What you'll usually do is index the row directly to get at the field you want, e.g. R[0][0] to get the first field of the first row. Array indexing of rows also works with the fields' names instead of their numbers, eg.: // Process employees' names one by one. ProcessNames() doesn't know exactly // what columns are going to be in R, but there must be one called "lastname". void ProcessNames(result R) { for (result::size_type i = 0; i != R.size(); ++i) Process(R[i]["lastname"]); } As for the alternative, accessing the result rows through an iterator, only const iterators are provided so the contents of the result cannot be modified. Use these iterators as random-access iterators like with any STL-like container: for (result::const_iterator i = R.begin(); i != R.end(); ++i) Process(*i); Iterators may be incremented or decremented (whether pre- or post-), they may be added to or subtracted from to jump through the result rows; their positions may be compared (provided they point into the same result), and they may be dereferenced through the * or -> operators. Finally, the iterated rows' fields may be addressed using the array index operator on the iterator directly, eg. R.begin()[0] gets you the first field of R's first row, just like R[0][0] would Or (*R.begin())[0]. It may seem quirky to have R.begin() and *R.begin() mean the same thing, but it makes practical use of iterators a lot easier. In fact it matches how arrays and pointers work in C and C++. . Either way, once you've indexed the row you get a field--which is another placeholder, but this time encapsulates an actual field value in our query result. A field F also knows its column name, which can be obtained as F.Name(). Again, there is more than one way to read the field's value. Let's start out with the easy one, c_str, which reads the value as a C string: cout << "Name: " << F.c_str() << endl; This will return the empty string ("") if field F has the null value. Use is_null to see if this is the case: if (!F.is_null()) cout << "Name: " << F.c_str() << endl; In practice of course, not all data is going to consist of strings. Many fields will be integer values, or decimals, or Booleans. To convert the field's value to one of these, use its to method. This adapts itself to the type of variable you pass it, expecting the field value to be of an appropriate form for that type. For convenience, to returns false if the field had the null value, and true otherwise. In the former case, the variable will retain the value it had before the call. // Pay an employee his salary. Add bonus for managers. // The employee row must contain the fields void PaySalary(result::const_iterator empl) { long id; float salary; bool is_manager=false; // Get id. Must never be null. if (!empl[0].to(id)) throw runtime_error("No id!"); // Get salary. If this employee has no salary, skip payment. if (!empl[1].to(salary)) return; // Get manager status. If field is null, variable's original value (false) // will be preserved. empl[2].to(is_manager); if (is_manager) salary += Bonus; TransferMoney(id, salary); } If conversion fails, e.g. when trying to convert a floating-point value to an integer variable, to will throw a runtime_error reporting the problem in its what message.
Doing Transactions Right: Transactors Writing database code can be tricky. One of the most complicated areas is dealing with unexpected error conditions, such as losing one's connection to the database server. For long-running processes you'll frequently find yourself rewriting code for a simple transaction to make it: Attempt to perform the transaction. Check for "connection lost" errors. Attempt to restore the connection. Repeat until the transaction succeeds. This is bad for the heart, and clutters up your code besides. The transactor framework will take this work out of your hands if you let it.
Functors The mechanism is based on the concept of Functors, a powerful object-oriented design pattern that replaces the older practice of passing callback functions (or hooks, as they're sometimes called, or exits) to foreign code. Unlike classic callback functions, Functors provide an elegant way of maintaining custom state in your callback code, when the exact form or size of that state was not known in advance to the writer of the foreign code that will eventually invoke your callback. Functors in C++ are simple objects that can be invoked just like functions or function pointers can, by virtue of providing the function invocation operator, operator(). A simple functor could look like this: struct HelloFunctor { void operator()() { cout << "Hello World" << endl; } }; ...And once an object of this functor type has been created, it can be "invoked" just as if it were a function: HelloFunctor Hi; Hi(); But the invoking code may also be foreign code knowing nothing about the type of your functor. The foreign code is usually a template, so it automatically becomes "specialized" to your type of functor when the one meets the other: template<typename FUNCTOR> void DoFunctor(const FUNCTOR &Hi) { Hi(); } The great thing about functors is that they can carry state. This is most useful when you need to pass a functor object to foreign code like DoFunctor above, but you need certain extra parameters to be passed to your functor that the foreign code isn't going to pass. The classic C solution to this problem is to let you pass both a function pointer and a pointer-to-void as a method of letting you provide any type of data of your liking to it. This generally makes programs a little harder to read, and is not very safe or convenient. With functors, there is a better way to do the same thing. Let's say you want to adapt the HelloFunctor class to print its output to a different output stream. What you'd really like to do is add a parameter to your () operator to indicate which stream to print to: void operator()(ostream &Stream) { Stream << "Hello World" << endl; } Unfortunately, DoFunctor doesn't know about this new parameter, let alone what argument to pass! So instead, let's make this Stream a class member: struct HelloFunctor { ostream &Stream; // Set Stream when creating a HelloFunctor explicit HelloFunctor(ostream &S) : Stream(S) { } // Print to output stream selected at construction time void operator()() { Stream << "Hello World" << endl; } }; We can now provide the necessary information (ie., which stream to print to) to our HelloFunctor before we pass it to DoFunctor: HelloFunctor Hi1(cout), Hi2(cerr); DoFunctor(Hi1); // Print to cout DoFunctor(Hi2); // Print to cerr Naturally a functor's () operator may also return some other type than void, and it may take arguments just like any other function. This mechanism is used extensively by the STL to sort containers, to find items in sorted containers like set or map, and so on.
How Transactors Work A transactor is a functor derived from an instantiation of libpqxx's transactor class template. Instead of writing your database transaction inline with the rest of your code, you encapsulate it in your functor's () operator. When the time comes to execute your transaction, you create an object of your functor type and pass it to the perform method of your connection to the database. perform will make a copy of your transactor (which means it needs to be copy-constructible, by the way). It will also create a transaction object and invoke your transactor's () operator, passing the transaction object to it. All your transactor needs to do is perform its queries on this object and return, after which perform will commit the transaction. If your () operator throws an exception instead, perform will discard the copy of your original transactor, and try again with a new copy until it either succeeds or eventually gives up perform gives up if the transaction fails too many times in succession. The maximum number of attempts that are made can be passed to perform as an optional second argument. . If the connection is lost, the transaction will fail but perform will restore it transparently and simply try again. To make all this work, your transactor's () operator must make no changes to the rest of your program's state. Any intermediate results, data to be processed, and so on, must stay within your transactor, and be destroyed when the transactor is. That is the magic trick that allows perform to create copies of your transactor and use them to rerun the transaction as many times as needed, without your program noticing. So how does your transactor pass query results back to the outside world once it's done? For this purpose, you may redefine transactor's on_commit member function to pass any data back to the rest of your program. This member function will be called only if your transaction succeeded. (You may also wish to go the other route, storing data to variables outside the transactor right away, and override the on_abort and on_doubt functions to remove the data again if the transaction failed, but this is much more likely to cause subtle bugs.) Please refer to the reference manual, the source code, and the test programs that come with libpqxx to learn more about how transactors work.
libpqxx-6.4.5/include/000077500000000000000000000000001350065432700146455ustar00rootroot00000000000000libpqxx-6.4.5/include/CMakeLists.txt000066400000000000000000000123471350065432700174140ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './include/CMakeLists.txt.template'. ################################################################################ install( DIRECTORY pqxx "${PROJECT_BINARY_DIR}/include/pqxx" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN array.hxx PATTERN array PATTERN basic_connection.hxx PATTERN basic_connection PATTERN binarystring.hxx PATTERN binarystring PATTERN compiler-internal-post.hxx PATTERN compiler-internal-post PATTERN compiler-internal-pre.hxx PATTERN compiler-internal-pre PATTERN compiler-internal.hxx PATTERN compiler-internal PATTERN compiler-public.hxx PATTERN compiler-public PATTERN connection.hxx PATTERN connection PATTERN connection_base.hxx PATTERN connection_base PATTERN connectionpolicy.hxx PATTERN connectionpolicy PATTERN cursor.hxx PATTERN cursor PATTERN dbtransaction.hxx PATTERN dbtransaction PATTERN errorhandler.hxx PATTERN errorhandler PATTERN except.hxx PATTERN except PATTERN field.hxx PATTERN field PATTERN isolation.hxx PATTERN isolation PATTERN largeobject.hxx PATTERN largeobject PATTERN nontransaction.hxx PATTERN nontransaction PATTERN notification.hxx PATTERN notification PATTERN pipeline.hxx PATTERN pipeline PATTERN prepared_statement.hxx PATTERN prepared_statement PATTERN result.hxx PATTERN result PATTERN result_iterator.hxx PATTERN result_iterator PATTERN robusttransaction.hxx PATTERN robusttransaction PATTERN row.hxx PATTERN row PATTERN strconv.hxx PATTERN strconv PATTERN stream_base.hxx PATTERN stream_base PATTERN stream_from.hxx PATTERN stream_from PATTERN stream_to.hxx PATTERN stream_to PATTERN subtransaction.hxx PATTERN subtransaction PATTERN tablereader.hxx PATTERN tablereader PATTERN tablestream.hxx PATTERN tablestream PATTERN tablewriter.hxx PATTERN tablewriter PATTERN transaction.hxx PATTERN transaction PATTERN transaction_base.hxx PATTERN transaction_base PATTERN transactor.hxx PATTERN transactor PATTERN types.hxx PATTERN types PATTERN util.hxx PATTERN util PATTERN version.hxx PATTERN version PATTERN internal/callgate.hxx PATTERN internal/encoding_group.hxx PATTERN internal/encodings.hxx PATTERN internal/ignore-deprecated-post.hxx PATTERN internal/ignore-deprecated-pre.hxx PATTERN internal/libpq-forward.hxx PATTERN internal/sql_cursor.hxx PATTERN internal/statement_parameters.hxx PATTERN internal/type_utils.hxx PATTERN internal/gates/connection-dbtransaction.hxx PATTERN internal/gates/connection-errorhandler.hxx PATTERN internal/gates/connection-largeobject.hxx PATTERN internal/gates/connection-notification_receiver.hxx PATTERN internal/gates/connection-parameterized_invocation.hxx PATTERN internal/gates/connection-pipeline.hxx PATTERN internal/gates/connection-prepare-invocation.hxx PATTERN internal/gates/connection-reactivation_avoidance_exemption.hxx PATTERN internal/gates/connection-sql_cursor.hxx PATTERN internal/gates/connection-transaction.hxx PATTERN internal/gates/errorhandler-connection.hxx PATTERN internal/gates/icursor_iterator-icursorstream.hxx PATTERN internal/gates/icursorstream-icursor_iterator.hxx PATTERN internal/gates/result-connection.hxx PATTERN internal/gates/result-creation.hxx PATTERN internal/gates/result-row.hxx PATTERN internal/gates/result-sql_cursor.hxx PATTERN internal/gates/transaction-sql_cursor.hxx PATTERN internal/gates/transaction-stream_from.hxx PATTERN internal/gates/transaction-stream_to.hxx PATTERN internal/gates/transaction-subtransaction.hxx PATTERN internal/gates/transaction-tablereader.hxx PATTERN internal/gates/transaction-tablewriter.hxx PATTERN internal/gates/transaction-transactionfocus.hxx PATTERN config-public-compiler.h PATTERN pqxx ) install( DIRECTORY pqxx/doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR} FILES_MATCHING PATTERN README.md PATTERN accessing-results.md PATTERN escaping.md PATTERN getting-started.md PATTERN mainpage.md PATTERN performance.md PATTERN prepared-statement.md PATTERN streams.md PATTERN thread-safety.md ) libpqxx-6.4.5/include/CMakeLists.txt.template000066400000000000000000000014141350065432700212170ustar00rootroot00000000000000install( DIRECTORY pqxx "${PROJECT_BINARY_DIR}/include/pqxx" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING ###MAKTEMPLATE:FOREACH include/pqxx/*.hxx PATTERN ###BASENAME###.hxx PATTERN ###BASENAME### ###MAKTEMPLATE:ENDFOREACH ###MAKTEMPLATE:FOREACH include/pqxx/internal/*.hxx PATTERN internal/###BASENAME###.hxx ###MAKTEMPLATE:ENDFOREACH ###MAKTEMPLATE:FOREACH include/pqxx/internal/gates/*.hxx PATTERN internal/gates/###BASENAME###.hxx ###MAKTEMPLATE:ENDFOREACH PATTERN config-public-compiler.h PATTERN pqxx ) install( DIRECTORY pqxx/doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR} FILES_MATCHING ###MAKTEMPLATE:FOREACH include/pqxx/doc/*.md PATTERN ###BASENAME###.md ###MAKTEMPLATE:ENDFOREACH ) libpqxx-6.4.5/include/Makefile.am000066400000000000000000000062071350065432700167060ustar00rootroot00000000000000SUBDIRS = pqxx nobase_include_HEADERS= pqxx/pqxx \ pqxx/array pqxx/array.hxx \ pqxx/basic_connection pqxx/basic_connection.hxx \ pqxx/binarystring pqxx/binarystring.hxx \ pqxx/compiler-public.hxx \ pqxx/compiler-internal-pre.hxx pqxx/compiler-internal-post.hxx \ pqxx/connection pqxx/connection.hxx \ pqxx/connection_base pqxx/connection_base.hxx \ pqxx/connectionpolicy pqxx/connectionpolicy.hxx \ pqxx/cursor pqxx/cursor.hxx \ pqxx/dbtransaction pqxx/dbtransaction.hxx \ pqxx/errorhandler pqxx/errorhandler.hxx \ pqxx/except pqxx/except.hxx \ pqxx/field pqxx/field.hxx \ pqxx/isolation pqxx/isolation.hxx \ pqxx/largeobject pqxx/largeobject.hxx \ pqxx/nontransaction pqxx/nontransaction.hxx \ pqxx/notification pqxx/notification.hxx \ pqxx/pipeline pqxx/pipeline.hxx \ pqxx/prepared_statement pqxx/prepared_statement.hxx \ pqxx/result pqxx/result.hxx \ pqxx/result_iterator.hxx \ pqxx/robusttransaction pqxx/robusttransaction.hxx \ pqxx/strconv pqxx/strconv.hxx \ pqxx/stream_base.hxx \ pqxx/stream_from pqxx/stream_from.hxx \ pqxx/stream_to pqxx/stream_to.hxx \ pqxx/subtransaction pqxx/subtransaction.hxx \ pqxx/tablereader pqxx/tablereader.hxx \ pqxx/tablestream pqxx/tablestream.hxx \ pqxx/tablewriter pqxx/tablewriter.hxx \ pqxx/transaction pqxx/transaction.hxx \ pqxx/transaction_base pqxx/transaction_base.hxx \ pqxx/transactor pqxx/transactor.hxx \ pqxx/row pqxx/row.hxx \ pqxx/util pqxx/util.hxx \ pqxx/types pqxx/types.hxx \ pqxx/version pqxx/version.hxx \ pqxx/internal/callgate.hxx \ pqxx/internal/encoding_group.hxx \ pqxx/internal/encodings.hxx \ pqxx/internal/libpq-forward.hxx \ pqxx/internal/sql_cursor.hxx \ pqxx/internal/statement_parameters.hxx \ pqxx/internal/type_utils.hxx \ pqxx/internal/gates/connection-dbtransaction.hxx \ pqxx/internal/gates/connection-errorhandler.hxx \ pqxx/internal/gates/connection-largeobject.hxx \ pqxx/internal/gates/connection-notification_receiver.hxx \ pqxx/internal/gates/connection-parameterized_invocation.hxx \ pqxx/internal/gates/connection-pipeline.hxx \ pqxx/internal/gates/connection-prepare-invocation.hxx \ pqxx/internal/gates/connection-reactivation_avoidance_exemption.hxx \ pqxx/internal/gates/connection-sql_cursor.hxx \ pqxx/internal/gates/connection-transaction.hxx \ pqxx/internal/gates/errorhandler-connection.hxx \ pqxx/internal/gates/icursorstream-icursor_iterator.hxx \ pqxx/internal/gates/icursor_iterator-icursorstream.hxx \ pqxx/internal/gates/result-connection.hxx \ pqxx/internal/gates/result-creation.hxx \ pqxx/internal/gates/result-row.hxx \ pqxx/internal/gates/result-sql_cursor.hxx \ pqxx/internal/gates/transaction-sql_cursor.hxx \ pqxx/internal/gates/transaction-stream_from.hxx \ pqxx/internal/gates/transaction-stream_to.hxx \ pqxx/internal/gates/transaction-subtransaction.hxx \ pqxx/internal/gates/transaction-tablereader.hxx \ pqxx/internal/gates/transaction-tablewriter.hxx \ pqxx/internal/gates/transaction-transactionfocus.hxx \ pqxx/internal/ignore-deprecated-pre.hxx \ pqxx/internal/ignore-deprecated-post.hxx nobase_nodist_include_HEADERS = \ pqxx/config-public-compiler.h EXTRA_DIST = \ pqxx/doc/*.md \ pqxx/version.hxx.template libpqxx-6.4.5/include/Makefile.in000066400000000000000000000630541350065432700167220ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(nobase_include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)" HEADERS = $(nobase_include_HEADERS) $(nobase_nodist_include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ SUBDIRS = pqxx nobase_include_HEADERS = pqxx/pqxx \ pqxx/array pqxx/array.hxx \ pqxx/basic_connection pqxx/basic_connection.hxx \ pqxx/binarystring pqxx/binarystring.hxx \ pqxx/compiler-public.hxx \ pqxx/compiler-internal-pre.hxx pqxx/compiler-internal-post.hxx \ pqxx/connection pqxx/connection.hxx \ pqxx/connection_base pqxx/connection_base.hxx \ pqxx/connectionpolicy pqxx/connectionpolicy.hxx \ pqxx/cursor pqxx/cursor.hxx \ pqxx/dbtransaction pqxx/dbtransaction.hxx \ pqxx/errorhandler pqxx/errorhandler.hxx \ pqxx/except pqxx/except.hxx \ pqxx/field pqxx/field.hxx \ pqxx/isolation pqxx/isolation.hxx \ pqxx/largeobject pqxx/largeobject.hxx \ pqxx/nontransaction pqxx/nontransaction.hxx \ pqxx/notification pqxx/notification.hxx \ pqxx/pipeline pqxx/pipeline.hxx \ pqxx/prepared_statement pqxx/prepared_statement.hxx \ pqxx/result pqxx/result.hxx \ pqxx/result_iterator.hxx \ pqxx/robusttransaction pqxx/robusttransaction.hxx \ pqxx/strconv pqxx/strconv.hxx \ pqxx/stream_base.hxx \ pqxx/stream_from pqxx/stream_from.hxx \ pqxx/stream_to pqxx/stream_to.hxx \ pqxx/subtransaction pqxx/subtransaction.hxx \ pqxx/tablereader pqxx/tablereader.hxx \ pqxx/tablestream pqxx/tablestream.hxx \ pqxx/tablewriter pqxx/tablewriter.hxx \ pqxx/transaction pqxx/transaction.hxx \ pqxx/transaction_base pqxx/transaction_base.hxx \ pqxx/transactor pqxx/transactor.hxx \ pqxx/row pqxx/row.hxx \ pqxx/util pqxx/util.hxx \ pqxx/types pqxx/types.hxx \ pqxx/version pqxx/version.hxx \ pqxx/internal/callgate.hxx \ pqxx/internal/encoding_group.hxx \ pqxx/internal/encodings.hxx \ pqxx/internal/libpq-forward.hxx \ pqxx/internal/sql_cursor.hxx \ pqxx/internal/statement_parameters.hxx \ pqxx/internal/type_utils.hxx \ pqxx/internal/gates/connection-dbtransaction.hxx \ pqxx/internal/gates/connection-errorhandler.hxx \ pqxx/internal/gates/connection-largeobject.hxx \ pqxx/internal/gates/connection-notification_receiver.hxx \ pqxx/internal/gates/connection-parameterized_invocation.hxx \ pqxx/internal/gates/connection-pipeline.hxx \ pqxx/internal/gates/connection-prepare-invocation.hxx \ pqxx/internal/gates/connection-reactivation_avoidance_exemption.hxx \ pqxx/internal/gates/connection-sql_cursor.hxx \ pqxx/internal/gates/connection-transaction.hxx \ pqxx/internal/gates/errorhandler-connection.hxx \ pqxx/internal/gates/icursorstream-icursor_iterator.hxx \ pqxx/internal/gates/icursor_iterator-icursorstream.hxx \ pqxx/internal/gates/result-connection.hxx \ pqxx/internal/gates/result-creation.hxx \ pqxx/internal/gates/result-row.hxx \ pqxx/internal/gates/result-sql_cursor.hxx \ pqxx/internal/gates/transaction-sql_cursor.hxx \ pqxx/internal/gates/transaction-stream_from.hxx \ pqxx/internal/gates/transaction-stream_to.hxx \ pqxx/internal/gates/transaction-subtransaction.hxx \ pqxx/internal/gates/transaction-tablereader.hxx \ pqxx/internal/gates/transaction-tablewriter.hxx \ pqxx/internal/gates/transaction-transactionfocus.hxx \ pqxx/internal/ignore-deprecated-pre.hxx \ pqxx/internal/ignore-deprecated-post.hxx nobase_nodist_include_HEADERS = \ pqxx/config-public-compiler.h EXTRA_DIST = \ pqxx/doc/*.md \ pqxx/version.hxx.template all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_includeHEADERS: $(nobase_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-nobase_nodist_includeHEADERS: $(nobase_nodist_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-nobase_includeHEADERS \ install-nobase_nodist_includeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-nobase_includeHEADERS \ uninstall-nobase_nodist_includeHEADERS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-nobase_includeHEADERS \ install-nobase_nodist_includeHEADERS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-nobase_includeHEADERS \ uninstall-nobase_nodist_includeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/include/pqxx/000077500000000000000000000000001350065432700156455ustar00rootroot00000000000000libpqxx-6.4.5/include/pqxx/Makefile.am000066400000000000000000000004441350065432700177030ustar00rootroot00000000000000MAINTAINERCLEANFILES=Makefile.in stamp-h.in noinst_HEADERS = \ compiler-internal.hxx \ config-internal-autotools.h nodist_noinst_HEADERS = \ config.h \ config-internal-compiler.h DISTCLEANFILES = \ config-internal-autotools.h \ config-internal-compiler.h \ config-public-compiler.h libpqxx-6.4.5/include/pqxx/Makefile.in000066400000000000000000000364561350065432700177300ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include/pqxx ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(nodist_noinst_HEADERS) $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ MAINTAINERCLEANFILES = Makefile.in stamp-h.in noinst_HEADERS = \ compiler-internal.hxx \ config-internal-autotools.h nodist_noinst_HEADERS = \ config.h \ config-internal-compiler.h DISTCLEANFILES = \ config-internal-autotools.h \ config-internal-compiler.h \ config-public-compiler.h all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/pqxx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/pqxx/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/pqxx/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) config.h installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/include/pqxx/array000066400000000000000000000002061350065432700167040ustar00rootroot00000000000000/** Handling of SQL arrays. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/array.hxx" libpqxx-6.4.5/include/pqxx/array.hxx000066400000000000000000000063501350065432700175200ustar00rootroot00000000000000/** Handling of SQL arrays. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/field instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_ARRAY #define PQXX_H_ARRAY #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/internal/encoding_group.hxx" #include "pqxx/internal/encodings.hxx" #include #include #include namespace pqxx { /// Low-level array parser. /** Use this to read an array field retrieved from the database. * * This parser will only work reliably if your client encoding is UTF-8, ASCII, * or a single-byte encoding which is a superset of ASCII (such as Latin-1). * * Also, the parser only supports array element types which use either a comma * or a semicolon ("," or ";") as the separator between array elements. All * built-in types use comma, except for one which uses semicolon, but some * custom types may not work. * * The input is a C-style string containing the textual representation of an * array, as returned by the database. The parser reads this representation * on the fly. The string must remain in memory until parsing is done. * * Parse the array by making calls to @c get_next until it returns a * @c juncture of "done". The @c juncture tells you what the parser found in * that step: did the array "nest" to a deeper level, or "un-nest" back up? */ class PQXX_LIBEXPORT array_parser { public: /// What's the latest thing found in the array? enum juncture { /// Starting a new row. row_start, /// Ending the current row. row_end, /// Found a NULL value. null_value, /// Found a string value. string_value, /// Parsing has completed. done, }; // XXX: Actually _pass_ encoding group! /// Constructor. You don't need this; use @c field::as_array instead. explicit array_parser( const char input[], internal::encoding_group=internal::encoding_group::MONOBYTE); /// Parse the next step in the array. /** Returns what it found. If the juncture is @c string_value, the string * will contain the value. Otherwise, it will be empty. * * Call this until the @c juncture it returns is @c done. */ std::pair get_next(); private: const char *const m_input; const std::string::size_type m_end; internal::glyph_scanner_func *const m_scan; /// Current parsing position in the input. std::string::size_type m_pos; std::string::size_type scan_single_quoted_string() const; std::string parse_single_quoted_string(std::string::size_type end) const; std::string::size_type scan_double_quoted_string() const; std::string parse_double_quoted_string(std::string::size_type end) const; std::string::size_type scan_unquoted_string() const; std::string parse_unquoted_string(std::string::size_type end) const; std::string::size_type scan_glyph(std::string::size_type pos) const; std::string::size_type scan_glyph( std::string::size_type pos, std::string::size_type end) const; }; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/basic_connection000066400000000000000000000003301350065432700210640ustar00rootroot00000000000000/** Connection class template. * * Combines the components of a connection into something usable. */ // Actual definitions in .hxx file so editors and such recognize file type #include "pqxx/basic_connection.hxx" libpqxx-6.4.5/include/pqxx/basic_connection.hxx000066400000000000000000000065641350065432700217110ustar00rootroot00000000000000/** Definition of the pqxx::basic_connection class template. * * Instantiations of basic_connection bring connections and policies together. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/basic_connection instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_BASIC_CONNECTION #define PQXX_H_BASIC_CONNECTION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include #include #include "pqxx/connection_base.hxx" namespace pqxx { /// Base-class template for all libpqxx connection types. /** @deprecated In libpqxx 7, all built-in connection types will be implemented * as a single class. You'll specify the connection policy as an optional * constructor argument. * * Combines connection_base (the highly complex class implementing essentially * all connection-related functionality) with a connection policy (a simpler * helper class determining the rules that govern the process of setting up the * underlying connection to the backend). * * The pattern used to combine these classes is the same as for * basic_transaction. Through use of the template mechanism, the policy object * is embedded in the basic_connection object so that it does not need to be * allocated separately. This also avoids the need for virtual functions in * this class. */ template class basic_connection_base : public connection_base { public: basic_connection_base() : connection_base(m_policy), m_options(std::string{}), m_policy(m_options) { init(); } /// The parsing of options is the same as libpq's PQconnect. /// See: https://www.postgresql.org/docs/10/static/libpq-connect.html explicit basic_connection_base(const std::string &opt) : connection_base(m_policy), m_options(opt), m_policy(m_options) {init();} /// See: @c basic_connection(const std::string &opt) explicit basic_connection_base(const char opt[]) : basic_connection_base(opt ? std::string{opt} : std::string{}) {} explicit basic_connection_base(std::nullptr_t) : basic_connection_base() {} ~basic_connection_base() noexcept { close(); } const std::string &options() const noexcept //[t01] {return m_policy.options();} private: /// Connect string. @warn Must be initialized before the connector! std::string m_options; /// Connection policy. @warn Must be initialized after the connect string! CONNECTPOLICY m_policy; }; /// Concrete connection type template. /** @deprecated In libpqxx 7, all built-in connection types will be implemented * as a single class. You'll specify the connection policy as an optional * constructor argument. */ template struct basic_connection : basic_connection_base { PQXX_DEPRECATED basic_connection() =default; PQXX_DEPRECATED explicit basic_connection(const std::string &opt) : basic_connection(opt) {} PQXX_DEPRECATED explicit basic_connection(const char opt[]) : basic_connection(opt) {} PQXX_DEPRECATED explicit basic_connection(std::nullptr_t) : basic_connection() {} using basic_connection_base::options; }; } // namespace #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/binarystring000066400000000000000000000002301350065432700202760ustar00rootroot00000000000000/** BYTEA (binary string) conversions. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/binarystring.hxx" libpqxx-6.4.5/include/pqxx/binarystring.hxx000066400000000000000000000127571350065432700211250ustar00rootroot00000000000000/** Representation for raw, binary data. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/binarystring instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_BINARYSTRING #define PQXX_H_BINARYSTRING #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include #include "pqxx/result.hxx" namespace pqxx { /// Binary data corresponding to PostgreSQL's "BYTEA" binary-string type. /** @ingroup escaping-functions * * This class represents a binary string as stored in a field of type bytea. * The raw value returned by a bytea field contains escape sequences for certain * characters, which are filtered out by binarystring. * * Internally a binarystring is zero-terminated, but it may also contain zero * bytes, just like any other byte value. So don't assume that it can be * treated as a C-style string unless you've made sure of this yourself. * * The binarystring retains its value even if the result it was obtained from is * destroyed, but it cannot be copied or assigned. * * \relatesalso transaction_base::esc_raw * * To convert the other way, i.e. from a raw series of bytes to a string * suitable for inclusion as bytea values in your SQL, use the transaction's * esc_raw() functions. * * @warning This class is implemented as a reference-counting smart pointer. * Copying, swapping, and destroying binarystring objects that refer to the same * underlying data block is not thread-safe. If you wish to pass * binarystrings around between threads, make sure that each of these operations * is protected against concurrency with similar operations on the same object, * or other objects pointing to the same data block. */ class PQXX_LIBEXPORT binarystring { public: using char_type = unsigned char; using value_type = std::char_traits::char_type; using size_type = size_t; using difference_type = long; using const_reference = const value_type &; using const_pointer = const value_type *; using const_iterator = const_pointer; using const_reverse_iterator = std::reverse_iterator; binarystring(const binarystring &) =default; /// Read and unescape bytea field /** The field will be zero-terminated, even if the original bytea field isn't. * @param F the field to read; must be a bytea field */ explicit binarystring(const field &); //[t62] /// Copy binary data from std::string. explicit binarystring(const std::string &); /// Copy binary data of given length straight out of memory. binarystring(const void *, size_t); /// Size of converted string in bytes size_type size() const noexcept { return m_size; } //[t62] /// Size of converted string in bytes size_type length() const noexcept { return size(); } //[t62] bool empty() const noexcept { return size()==0; } //[t62] const_iterator begin() const noexcept { return data(); } //[t62] const_iterator cbegin() const noexcept { return begin(); } const_iterator end() const noexcept { return data()+m_size; } //[t62] const_iterator cend() const noexcept { return end(); } const_reference front() const noexcept { return *begin(); } //[t62] const_reference back() const noexcept //[t62] { return *(data()+m_size-1); } const_reverse_iterator rbegin() const //[t62] { return const_reverse_iterator{end()}; } const_reverse_iterator crbegin() const { return rbegin(); } const_reverse_iterator rend() const //[t62] { return const_reverse_iterator{begin()}; } const_reverse_iterator crend() const { return rend(); } /// Unescaped field contents const value_type *data() const noexcept {return m_buf.get();} //[t62] const_reference operator[](size_type i) const noexcept //[t62] { return data()[i]; } PQXX_PURE bool operator==(const binarystring &) const noexcept; //[t62] bool operator!=(const binarystring &rhs) const noexcept //[t62] { return not operator==(rhs); } binarystring &operator=(const binarystring &); /// Index contained string, checking for valid index const_reference at(size_type) const; //[t62] /// Swap contents with other binarystring void swap(binarystring &); //[t62] /// Raw character buffer (no terminating zero is added) /** @warning No terminating zero is added! If the binary data did not end in * a null character, you will not find one here. */ const char *get() const noexcept //[t62] { return reinterpret_cast(m_buf.get()); } /// Read as regular C++ string (may include null characters) /** @warning libpqxx releases before 3.1 stored the string and returned a * reference to it. This is no longer the case! It now creates and returns * a new string object. Avoid repeated use of this function; retrieve your * string once and keep it in a local variable. Also, do not expect to be * able to compare the string's address to that of an earlier invocation. */ std::string str() const; //[t62] private: using smart_pointer_type = std::shared_ptr; /// Shorthand: construct a smart_pointer_type. static smart_pointer_type make_smart_pointer(unsigned char *buf=nullptr) { return smart_pointer_type{ buf, internal::freemallocmem_templated}; } smart_pointer_type m_buf; size_type m_size; }; } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/compiler-internal-post.hxx000066400000000000000000000011171350065432700230050ustar00rootroot00000000000000/** Compiler deficiency workarounds for compiling libpqxx headers. * * To be included at the end of each libpqxx header, in order to restore the * client program's settings. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ // NO GUARDS HERE! This code should be executed every time! #ifdef _WIN32 #ifdef _MSC_VER #pragma warning (pop) // Restore client program's warning state #endif #endif libpqxx-6.4.5/include/pqxx/compiler-internal-pre.hxx000066400000000000000000000023121350065432700226040ustar00rootroot00000000000000/** Compiler deficiency workarounds for compiling libpqxx headers. * * To be called at the start of each libpqxx header, in order to push the * client program's settings and apply libpqxx's settings. * * Must be balanced by an include of -header-post.hxx at the end * of the header. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ // NO GUARDS HERE! This code should be executed every time! #ifdef _WIN32 #ifdef _MSC_VER // Save client program warning state, and set warning level 4. // Setting the warning level explicitly ensures that libpqxx // headers will work with this warning level as well. #pragma warning (push,4) #pragma warning (disable: 4251) #pragma warning (disable: 4273) #pragma warning (disable: 4275) #pragma warning (disable: 4355) #pragma warning (disable: 4511) // Copy constructor could not be generated. #pragma warning (disable: 4512) // Assignment operator could not be generated. #pragma warning (disable: 4996) // Deprecation warning, e.g. about strncpy(). #endif // _MSC_VER #endif // _WIN32 libpqxx-6.4.5/include/pqxx/compiler-internal.hxx000066400000000000000000000022311350065432700220200ustar00rootroot00000000000000/** Compiler deficiency workarounds for compiling libpqxx itself. * * DO NOT INCLUDE THIS FILE when building client programs. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_COMPILER_INTERNAL #define PQXX_H_COMPILER_INTERNAL // Workarounds & definitions needed to compile libpqxx into a library #include "pqxx/config-internal-compiler.h" #ifdef _WIN32 #ifdef PQXX_SHARED #undef PQXX_LIBEXPORT #define PQXX_LIBEXPORT __declspec(dllexport) #define PQXX_PRIVATE __declspec() #endif // PQXX_SHARED #ifdef _MSC_VER #pragma warning (disable: 4251 4275 4273) #pragma warning (disable: 4355) #pragma warning (disable: 4996) // Deprecation warning, e.g. about strncpy(). #endif #elif defined(__GNUC__) && defined(PQXX_HAVE_GCC_VISIBILITY) // !_WIN32 #define PQXX_LIBEXPORT __attribute__ ((visibility("default"))) #define PQXX_PRIVATE __attribute__ ((visibility("hidden"))) #endif // __GNUC__ && PQXX_HAVE_GCC_VISIBILITY #include "pqxx/compiler-public.hxx" #endif libpqxx-6.4.5/include/pqxx/compiler-public.hxx000066400000000000000000000064431350065432700214730ustar00rootroot00000000000000/** Compiler deficiency workarounds for libpqxx clients. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_COMPILER_PUBLIC #define PQXX_H_COMPILER_PUBLIC // Workarounds & definitions that need to be included even in library's headers #include "pqxx/config-public-compiler.h" // Some compilers, Visual Studio in particular, don't seem to support the // standard's ISO-646 keywords out of the box. #include #if defined(__GNUC__) && defined(PQXX_HAVE_GCC_CONST) /// Declare function without effects and without reading anything but its args. #define PQXX_CONST __attribute__ ((const)) #else #define PQXX_CONST #endif #if defined(PQXX_HAVE_DEPRECATED) /// Mark an item as deprecated. #define PQXX_DEPRECATED [[deprecated]] #elif defined(__GNUC__) && defined(PQXX_HAVE_GCC_DEPRECATED) #define PQXX_DEPRECATED __attribute__ ((deprecated)) #else #define PQXX_DEPRECATED #endif #if defined(__GNUC__) && defined(PQXX_HAVE_GCC_PURE) /// Declare function "pure": no side effects, only reads globals and its args. #define PQXX_PURE __attribute__ ((pure)) #else #define PQXX_PURE #endif // Workarounds for Windows #ifdef _WIN32 /* For now, export DLL symbols if _DLL is defined. This is done automatically * by the compiler when linking to the dynamic version of the runtime library, * according to "gzh" */ #if !defined(PQXX_LIBEXPORT) && defined(PQXX_SHARED) #define PQXX_LIBEXPORT __declspec(dllimport) #endif // !PQXX_LIBEXPORT && PQXX_SHARED // Workarounds for Microsoft Visual C++ #ifdef _MSC_VER // Suppress vtables on abstract classes. #define PQXX_NOVTABLE __declspec(novtable) // Automatically link with the appropriate libpq (static or dynamic, debug or // release). The default is to use the release DLL. Define PQXX_PQ_STATIC to // link to a static version of libpq, and _DEBUG to link to a debug version. // The two may be combined. #if defined(PQXX_AUTOLINK) #if defined(PQXX_PQ_STATIC) #ifdef _DEBUG #pragma comment(lib, "libpqd") #else #pragma comment(lib, "libpq") #endif #else #ifdef _DEBUG #pragma comment(lib, "libpqddll") #else #pragma comment(lib, "libpqdll") #endif #endif #endif // If we're not compiling libpqxx itself, automatically link with the // appropriate libpqxx library. To link with the libpqxx DLL, define // PQXX_SHARED; the default is to link with the static library. A static link // is the recommended practice. // // The preprocessor macro PQXX_INTERNAL is used to detect whether we // are compiling the libpqxx library itself. When you compile the library // yourself using your own project file, make sure to include this macro. #if defined(PQXX_AUTOLINK) && !defined(PQXX_INTERNAL) #ifdef PQXX_SHARED #ifdef _DEBUG #pragma comment(lib, "libpqxxD") #else #pragma comment(lib, "libpqxx") #endif #else // !PQXX_SHARED #ifdef _DEBUG #pragma comment(lib, "libpqxx_staticD") #else #pragma comment(lib, "libpqxx_static") #endif #endif #endif #endif // _MSC_VER #endif // _WIN32 #ifndef PQXX_LIBEXPORT #define PQXX_LIBEXPORT #endif #ifndef PQXX_PRIVATE #define PQXX_PRIVATE #endif #ifndef PQXX_NOVTABLE #define PQXX_NOVTABLE #endif #endif libpqxx-6.4.5/include/pqxx/config.h.in000066400000000000000000000054371350065432700177010ustar00rootroot00000000000000/* include/pqxx/config.h.in. Generated from configure.ac by autoheader. */ /* most gcc compilers know a function __attribute__((__const__)) */ #undef GCC_CONST_CALL /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `pq' library (-lpq). */ #undef HAVE_LIBPQ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* System supports poll(). */ #undef HAVE_POLL /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define if supports floating-point conversion. */ #undef PQXX_HAVE_CHARCONV_FLOAT /* Define if supports integer conversion. */ #undef PQXX_HAVE_CHARCONV_INT /* Define if compiler supports [[deprecated]] attribute */ #undef PQXX_HAVE_DEPRECATED /* Define if the compiler supports std::experimental::optional. */ #undef PQXX_HAVE_EXP_OPTIONAL /* Define if g++ supports const attribute. */ #undef PQXX_HAVE_GCC_CONST /* Define if g++ supports deprecated attribute. */ #undef PQXX_HAVE_GCC_DEPRECATED /* Define if g++ supports pure attribute */ #undef PQXX_HAVE_GCC_PURE /* Define if g++ supports visibility attribute. */ #undef PQXX_HAVE_GCC_VISIBILITY /* Define if the compiler supports std::optional. */ #undef PQXX_HAVE_OPTIONAL /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION libpqxx-6.4.5/include/pqxx/connection000066400000000000000000000003371350065432700177320ustar00rootroot00000000000000/** pqxx::connection and pqxx::lazyconnection classes. * * Different ways of setting up a backend connection. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/connection.hxx" libpqxx-6.4.5/include/pqxx/connection.hxx000066400000000000000000000153431350065432700205430ustar00rootroot00000000000000/** Definition of the pqxx::connection and pqxx::lazyconnection classes. * * Different ways of setting up a backend connection. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/connection instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_CONNECTION #define PQXX_H_CONNECTION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/connectionpolicy.hxx" #include "pqxx/basic_connection.hxx" namespace pqxx { /** * @addtogroup connection Connection classes * * The connection classes are where the use of a database begins. You must * connect to a database in order to access it. Your connection represents a * session with the database. In the context of that connection you can create * transactions, which in turn you can use to execute SQL. A connection can * have only one regular transaction open at a time, but you can break your work * down into any number of consecutive transactions and there is also some * support for transaction nesting (using the subtransaction class). * * Many things come together in the connection classes. Handling of error and * warning messages, for example, is defined by @e errorhandlers in the context * of a connection. Prepared statements are also defined here. * * @warning In libpqxx 7, all built-in connection types will be implemented * as a single class. You'll specify the connection policy as an optional * constructor argument. * * Several types of connections are available, including plain connection and * lazyconnection. These types are aliases combining a derivative of the * connection_base class (where essentially all connection-related functionality * is defined) with a policy class which governs how the connection is to be * established. You pass details such as the database you wish to connect to, * username and password, and so on as as PostgreSQL "connection string" and * certain environment variables that you can learn more about from the core * postgres documentation. * * See the connection_base documentation for a full list of features inherited * by all connection classes. Connections can be deactivated and reactivated if * needed (within reason, of course--you can't do this in the middle of a * transaction), and where possible, disabled or broken connections are * transparently re-enabled when you use them again. This is called * "reactivation," and you may need to understand it because you'll want it * disabled in certain situations. * * @warning Connection deactivation/reactivation will probably be removed in * libpqxx 7. If your application relies on an ability to "put connections to * sleep" and reactivate them later, you'll need to wrap them in some way to * handle this. * * You can also set certain variables defined by the backend to influence its * behaviour for the duration of your session, such as the applicable text * encoding. You can query the connection's capabilities (because some features * will depend on the versions of libpq and of the server backend that you're * using) and parameters that you set in your connection string and/or * environment variables. * * @{ */ /// Connection policy; creates an immediate connection to a database. /** This is the policy you typically need when you work with a database through * libpqxx. It connects to the database immediately. Another option is to * defer setting up the underlying connection to the database until it's * actually needed; the connect_lazy policy implements such "lazy" * behaviour. * * The advantage of having an "immediate" connection (as this policy gives you) * is that any errors in setting up the connection will occur during * construction of the connection object, rather than at some later point * further down your program. */ class PQXX_LIBEXPORT connect_direct : public connectionpolicy { public: /// The parsing of options is the same as in libpq's PQconnect. /// See: https://www.postgresql.org/docs/10/static/libpq-connect.html explicit connect_direct(const std::string &opts) : connectionpolicy{opts} {} virtual handle do_startconnect(handle) override; }; /// The "standard" connection type: connect to database right now using connection = basic_connection_base; /// Lazy connection policy; causes connection to be deferred until first use. /** This is connect_direct's lazy younger brother. It does not attempt to open * a connection right away; the connection is only created when it is actually * used. */ class PQXX_LIBEXPORT connect_lazy : public connectionpolicy { public: /// The parsing of options is the same as in libpq's PQconnect. /// See: https://www.postgresql.org/docs/10/static/libpq-connect.html explicit connect_lazy(const std::string &opts) : connectionpolicy{opts} {} virtual handle do_completeconnect(handle) override; }; /// A "lazy" connection type: connect to database only when needed using lazyconnection = basic_connection_base; /// Asynchronous connection policy; connects "in the background" /** Connection is initiated immediately, but completion is deferred until the * connection is actually needed. * * This may help performance by allowing the client to do useful work while * waiting for an answer from the server. */ class PQXX_LIBEXPORT connect_async : public connectionpolicy { public: /// The parsing of options is the same as in libpq's PQConnect /// See: https://www.postgresql.org/docs/10/static/libpq-connect.html explicit connect_async(const std::string &opts); virtual handle do_startconnect(handle) override; virtual handle do_completeconnect(handle) override; virtual handle do_dropconnect(handle) noexcept override; virtual bool is_ready(handle) const noexcept override; private: /// Is a connection attempt in progress? bool m_connecting; }; /// "Asynchronous" connection type: start connecting, but don't wait for it using asyncconnection = basic_connection_base; /// Nonfunctional, always-down connection policy for testing/debugging purposes /** @warning You don't want to use this policy in normal code. * Written for debugging and testing, this "connection policy" always fails to * connect, and the internal connection pointer always remains null. */ class PQXX_LIBEXPORT connect_null : public connectionpolicy { public: explicit connect_null(const std::string &opts) : connectionpolicy{opts} {} }; /// A "dummy" connection type: don't connect to any database at all using nullconnection = basic_connection_base; /** * @} */ } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/connection_base000066400000000000000000000003561350065432700207250ustar00rootroot00000000000000/** pqxx::connection_base abstract base class. * * pqxx::connection_base encapsulates a frontend-to-backend connection. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/connection_base.hxx" libpqxx-6.4.5/include/pqxx/connection_base.hxx000066400000000000000000001111171350065432700215310ustar00rootroot00000000000000/** Definition of the pqxx::connection_base abstract base class. * * pqxx::connection_base encapsulates a frontend to backend connection * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/connection_base instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_CONNECTION_BASE #define PQXX_H_CONNECTION_BASE #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include #include #include #include "pqxx/errorhandler.hxx" #include "pqxx/except.hxx" #include "pqxx/prepared_statement.hxx" #include "pqxx/strconv.hxx" #include "pqxx/util.hxx" #include "pqxx/version.hxx" /* Use of the libpqxx library starts here. * * Everything that can be done with a database through libpqxx must go through * a connection object derived from connection_base. */ /* Methods tested in eg. self-test program test1 are marked with "//[t01]" */ namespace pqxx { namespace internal { class reactivation_avoidance_exemption; class sql_cursor; class reactivation_avoidance_counter { public: reactivation_avoidance_counter() =default; void add(int n) noexcept { m_counter += n; } void clear() noexcept { m_counter = 0; } int get() const noexcept { return m_counter; } private: int m_counter = 0; }; } /// Encrypt password for given user. /** Use this when setting a new password for the user if password encryption is * enabled. Inputs are the username the password is for, and the plaintext * password. * * @return encrypted version of the password, suitable for encrypted PostgreSQL * authentication. * * Thus the password for a user can be changed with: * @code * void setpw(transaction_base &t, const string &user, const string &pw) * { * t.exec("ALTER USER " + user + " " * "PASSWORD '" + encrypt_password(user,pw) + "'"); * } * @endcode */ std::string PQXX_LIBEXPORT encrypt_password( //[t00] const std::string &user, const std::string &password); namespace internal { namespace gate { class connection_dbtransaction; class connection_errorhandler; class connection_largeobject; class connection_notification_receiver; class connection_parameterized_invocation; class connection_pipeline; class connection_prepare_invocation; class connection_reactivation_avoidance_exemption; class connection_sql_cursor; class connection_transaction; class const_connection_largeobject; } // namespace pqxx::internal::gate } // namespace pqxx::internal /// connection_base abstract base class; represents a connection to a database. /** This is the first class to look at when you wish to work with a database * through libpqxx. Depending on the implementing concrete child class, a * connection can be automatically opened when it is constructed, or when it is * first used, or somewhere inbetween. The connection is automatically closed * upon destruction (if it hasn't been closed already). * * To query or manipulate the database once connected, use one of the * transaction classes (see pqxx/transaction_base.hxx) or preferably the * transactor framework (see pqxx/transactor.hxx). * * If a network connection to the database server fails, the connection will be * restored automatically (although any transaction going on at the time will * have to be aborted). This also means that any information set in previous * transactions that is not stored in the database, such as temp tables or * connection-local variables defined with PostgreSQL's SET command, will be * lost. Whenever you create such state, either keept it local to one * transaction, where possible, or inhibit automatic reactivation of the * connection using the inhibit_reactivation() method. * * When a connection breaks, you will typically get a broken_connection * exception. This can happen at almost any point, and the details may depend * on which connection class (all derived from this one) you use. * * As a general rule, always avoid raw queries if libpqxx offers a dedicated * function for the same purpose. There may be hidden logic to hide certain * complications from you, such as reinstating session variables when a * broken or disabled connection is reactivated. * * @warning On Unix-like systems, including GNU and BSD systems, your program * may receive the SIGPIPE signal when the connection to the backend breaks. By * default this signal will abort your program. Use "signal(SIGPIPE, SIG_IGN)" * if you want your program to continue running after a connection fails. */ class PQXX_LIBEXPORT connection_base { public: /// Explicitly close connection. void disconnect() noexcept; //[t02] /// Is this connection open at the moment? /** @warning This function is @b not needed in most code. Resist the * temptation to check it after opening a connection; instead, rely on the * broken_connection exception that will be thrown on connection failure. */ bool PQXX_PURE is_open() const noexcept; //[t01] /** * @name Activation * * @warning Connection deactivation/reactivation will probably be removed in * libpqxx 7. If your application relies on an ability to "put connections * to sleep" and reactivate them later, you'll need to wrap them in some way * to handle this. * * Connections can be temporarily deactivated, or they can break because of * overly impatient firewalls dropping TCP connections. Where possible, * libpqxx will try to re-activate these when resume using them, or you can * wake them up explicitly. You probably won't need this feature, but you * should be aware of it. */ //@{ /// @deprecated Explicitly activate deferred or deactivated connection. /** Use of this method is entirely optional. Whenever a connection is used * while in a deferred or deactivated state, it will transparently try to * bring itself into an activated state. This function is best viewed as an * explicit hint to the connection that "if you're not in an active state, now * would be a good time to get into one." Whether a connection is currently * in an active state or not makes no real difference to its functionality. * There is also no particular need to match calls to activate() with calls to * deactivate(). A good time to call activate() might be just before you * first open a transaction on a lazy connection. */ PQXX_DEPRECATED void activate(); //[t12] /// @deprecated Explicitly deactivate connection. /** Like its counterpart activate(), this method is entirely optional. * Calling this function really only makes sense if you won't be using this * connection for a while and want to reduce the number of open connections on * the database server. * There is no particular need to match or pair calls to deactivate() with * calls to activate(), but calling deactivate() during a transaction is an * error. */ PQXX_DEPRECATED void deactivate(); //[t12] /// @deprecated Disallow (or permit) connection recovery /** A connection whose underlying socket is not currently connected to the * server will normally (re-)establish communication with the server whenever * needed, or when the client program requests it (although for reasons of * integrity, never inside a transaction; but retrying the whole transaction * may implicitly cause the connection to be restored). In normal use this is * quite a convenient thing to have and presents a simple, safe, predictable * interface. * * There is at least one situation where this feature is not desirable, * however. Although most session state (prepared statements, session * variables) is automatically restored to its working state upon connection * reactivation, temporary tables and so-called WITH HOLD cursors (which can * live outside transactions) are not. * * Cursors that live outside transactions are automatically handled, and the * library will quietly ignore requests to deactivate or reactivate * connections while they exist; it does not want to give you the illusion of * being back in your transaction when in reality you just dropped a cursor. * With temporary tables this is not so easy: there is no easy way for the * library to detect their creation or track their lifetimes. * * So if your program uses temporary tables, and any part of this use happens * outside of any database transaction (or spans multiple transactions), some * of the work you have done on these tables may unexpectedly be undone if the * connection is broken or deactivated while any of these tables exists, and * then reactivated or implicitly restored before you are finished with it. * * If this describes any part of your program, guard it against unexpected * reconnections by inhibiting reconnection at the beginning. And if you want * to continue doing work on the connection afterwards that no longer requires * the temp tables, you can permit it again to get the benefits of connection * reactivation for the remainder of the program. * * @param inhibit should reactivation be inhibited from here on? * * @warning Some connection types (the lazy and asynchronous types) defer * completion of the socket-level connection until it is actually needed by * the client program. Inhibiting reactivation before this connection is * really established will prevent these connection types from doing their * work. For those connection types, if you are sure that reactivation needs * to be inhibited before any query goes across the connection, activate() the * connection first. This will ensure that definite activation happens before * you inhibit it. */ PQXX_DEPRECATED void inhibit_reactivation(bool inhibit) //[t86] { m_inhibit_reactivation=inhibit; } /// Make the connection fail. @warning Do not use this except for testing! /** Breaks the connection in some unspecified, horrible, dirty way to enable * failure testing. * * Do not use this in normal programs. This is only meant for testing. */ void simulate_failure(); //[t94] //@} /// Invoke notice processor function. The message should end in newline. void process_notice(const char[]) noexcept; //[t14] /// Invoke notice processor function. Newline at end is recommended. void process_notice(const std::string &) noexcept; //[t14] /// Enable tracing to a given output stream, or nullptr to disable. void trace(std::FILE *) noexcept; //[t03] /** * @name Connection properties * * These are probably not of great interest, since most are derived from * information supplied by the client program itself, but they are included * for completeness. */ //@{ /// Name of database we're connected to, if any. /** @warning This activates the connection, which may fail with a * broken_connection exception. */ const char *dbname(); //[t01] /// Database user ID we're connected under, if any. /** @warning This activates the connection, which may fail with a * broken_connection exception. */ const char *username(); //[t01] /// Address of server, or nullptr if none specified (i.e. default or local) /** @warning This activates the connection, which may fail with a * broken_connection exception. */ const char *hostname(); //[t01] /// Server port number we're connected to. /** @warning This activates the connection, which may fail with a * broken_connection exception. */ const char *port(); //[t01] /// Process ID for backend process. /** Use with care: connections may be lost and automatically re-established * without your knowledge, in which case this process ID may no longer be * correct. You may, however, assume that this number remains constant and * reliable within the span of a successful backend transaction. If the * transaction fails, which may be due to a lost connection, then this number * will have become invalid at some point within the transaction. * * @return Process identifier, or 0 if not currently connected. */ int PQXX_PURE backendpid() const noexcept; //[t01] /// Socket currently used for connection, or -1 for none. Use with care! /** Query the current socket number. This is intended for event loops based * on functions such as select() or poll(), where multiple file descriptors * are watched. * * Please try to stay away from this function. It is really only meant for * event loops that need to wait on more than one file descriptor. If all you * need is to block until a notification arrives, for instance, use * await_notification(). If you want to issue queries and retrieve results in * nonblocking fashion, check out the pipeline class. * * @warning Don't store this value anywhere, and always be prepared for the * possibility that, at any given time, there may not be a socket! The * socket may change or even go away or be established during any invocation * of libpqxx code on the connection, no matter how trivial. */ int PQXX_PURE sock() const noexcept; //[t87] /** * @name Capabilities * * Some functionality may only be available in certain versions of the * backend, or only when speaking certain versions of the communications * protocol that connects us to the backend. */ //@{ /// Session capabilities. /** No capabilities are defined at the moment: all capabilities that older * versions checked for are now always supported. */ enum capability { /// Not a capability value; end-of-enumeration marker cap_end, }; /// Does this connection seem to support the given capability? /** Don't try to be smart by caching this information anywhere. Obtaining it * is quite fast (especially after the first time) and what's more, a * capability may "suddenly" appear or disappear if the connection is broken * or deactivated, and then restored. This may happen silently any time no * backend transaction is active; if it turns out that the server was upgraded * or restored from an older backup, or the new connection goes to a different * backend, then the restored session may have different capabilities than * were available previously. * * Some guesswork is involved in establishing the presence of any capability; * try not to rely on this function being exactly right. * * @warning Make sure your connection is active before calling this function, * or the answer will always be "no." In particular, if you are using this * function on a newly-created lazyconnection, activate the connection first. */ bool supports(capability c) const noexcept //[t88] { return m_caps.test(c); } /// What version of the PostgreSQL protocol is this connection using? /** The answer can be 0 (when there is no connection); 3 for protocol 3.0; or * possibly higher values as newer protocol versions are taken into use. * * If the connection is broken and restored, the restored connection could * possibly use a different server and protocol version. This would normally * happen if the server is upgraded without shutting down the client program, * for example. */ int PQXX_PURE protocol_version() const noexcept; //[t01] /// What version of the PostgreSQL server are we connected to? /** The result is a bit complicated: each of the major, medium, and minor * release numbers is written as a two-digit decimal number, and the three * are then concatenated. Thus server version 9.4.2 will be returned as the * decimal number 90402. If there is no connection to the server, this * returns zero. * * @warning When writing version numbers in your code, don't add zero at the * beginning! Numbers beginning with zero are interpreted as octal (base-8) * in C++. Thus, 070402 is not the same as 70402, and 080000 is not a number * at all because there is no digit "8" in octal notation. Use strictly * decimal notation when it comes to these version numbers. */ int PQXX_PURE server_version() const noexcept; //[t01] //@} /// @name Text encoding /** * Each connection is governed by a "client encoding," which dictates how * strings and other text is represented in bytes. The database server will * send text data to you in this encoding, and you should use it for the * queries and data which you send to the server. * * Search the PostgreSQL documentation for "character set encodings" to find * out more about the available encodings, how to extend them, and how to use * them. Not all server-side encodings are compatible with all client-side * encodings or vice versa. * * Encoding names are case-insensitive, so e.g. "UTF8" is equivalent to * "utf8". * * You can change the client encoding, but this may not work when the * connection is in a special state, such as when streaming a table. It's * not clear what happens if you change the encoding during a transaction, * and then abort the transaction. */ //@{ /// Get client-side character encoding, by name. std::string get_client_encoding() const; /// Set client-side character encoding, by name. /** * @param Encoding Name of the character set encoding to use. */ void set_client_encoding(const std::string &encoding); //[t07] /// Set client-side character encoding, by name. /** * @param Encoding Name of the character set encoding to use. */ void set_client_encoding(const char encoding[]); //[t07] /// Get the connection's encoding, as a PostgreSQL-defined code. int PQXX_PRIVATE encoding_id() const; //@} /// Set session variable /** Set a session variable for this connection, using the SET command. If the * connection to the database is lost and recovered, the last-set value will * be restored automatically. See the PostgreSQL documentation for a list of * variables that can be set and their permissible values. * If a transaction is currently in progress, aborting that transaction will * normally discard the newly set value. However nontransaction (which * doesn't start a real backend transaction) is an exception. * * @warning Do not mix the set_variable interface with manual setting of * variables by executing the corresponding SQL commands, and do not get or * set variables while a tablestream or pipeline is active on the same * connection. * @param Var Variable to set * @param Value Value vor Var to assume: an identifier, a quoted string, or a * number. */ void set_variable( //[t60] const std::string &Var, const std::string &Value); /// Read session variable /** Will try to read the value locally, from the list of variables set with * the set_variable function. If that fails, the database is queried. * @warning Do not mix the set_variable interface with manual setting of * variables by executing the corresponding SQL commands, and do not get or * set variables while a tablestream or pipeline is active on the same * connection. */ std::string get_variable(const std::string &); //[t60] //@} /** * @name Notifications and Receivers */ //@{ /// Check for pending notifications and take appropriate action. /** * All notifications found pending at call time are processed by finding * any matching receivers and invoking those. If no receivers matched the * notification string, none are invoked but the notification is considered * processed. * * Exceptions thrown by client-registered receivers are reported using the * connection's errorhandlers, but the exceptions themselves are not passed * on outside this function. * * @return Number of notifications processed */ int get_notifs(); //[t04] /// Wait for a notification to come in /** The wait may also be terminated by other events, such as the connection * to the backend failing. Any pending or received notifications are * processed as part of the call. * * @return Number of notifications processed */ int await_notification(); //[t78] /// Wait for a notification to come in, or for given timeout to pass /** The wait may also be terminated by other events, such as the connection * to the backend failing. Any pending or received notifications are * processed as part of the call. * @return Number of notifications processed */ int await_notification(long seconds, long microseconds); //[t79] //@} /** * @name Prepared statements * * PostgreSQL supports prepared SQL statements, i.e. statements that can be * registered under a client-provided name, optimized once by the backend, and * executed any number of times under the given name. * * Prepared statement definitions are not sensitive to transaction boundaries; * a statement defined inside a transaction will remain defined outside that * transaction, even if the transaction itself is subsequently aborted. Once * a statement has been prepared, only closing the connection or explicitly * "unpreparing" it can make it go away. * * Use the @c pqxx::transaction_base::exec_prepared functions to execute a * prepared statement. Use @c prepared().exists() to find out whether a * statement has been prepared under a given name. See \ref prepared for a * full discussion. * * Never try to prepare, execute, or unprepare a prepared statement manually * using direct SQL queries. Always use the functions provided by libpqxx. * * @{ */ /// Define a prepared statement. /** * The statement's definition can refer to a parameter using the parameter's * positional number n in the definition. For example, the first parameter * can be used as a variable "$1", the second as "$2" and so on. * * Here's an example of how to use prepared statements. Note the unusual * syntax for passing parameters: every new argument is a parenthesized * expression that is simply tacked onto the end of the statement! * * @code * using namespace pqxx; * void foo(connection_base &C) * { * C.prepare("findtable", "select * from pg_tables where name=$1"); * work W{C}; * result R = W.exec_prepared("findtable", "mytable"); * if (R.empty()) throw runtime_error{"mytable not found!"}; * } * @endcode * * To save time, prepared statements aren't really registered with the backend * until they are first used. If this is not what you want, e.g. because you * have very specific realtime requirements, you can use the @c prepare_now() * function to force immediate preparation. * * The statement may not be registered with the backend until it is actually * used. So if, for example, the statement is syntactically incorrect, you * may see a syntax_error here, or later when you try to call the statement, * or during a @c prepare_now() call. * * @param name unique name for the new prepared statement. * @param definition SQL statement to prepare. */ void prepare(const std::string &name, const std::string &definition); /// Define a nameless prepared statement. /** * This can be useful if you merely want to pass large binary parameters to a * statement without otherwise wishing to prepare it. If you use this * feature, always keep the definition and the use close together to avoid * the nameless statement being redefined unexpectedly by code somewhere else. */ void prepare(const std::string &definition); /// Drop prepared statement. void unprepare(const std::string &name); /// Request that prepared statement be registered with the server. /** If the statement had already been fully prepared, this will do nothing. * * If the connection should break and be transparently restored, then the new * connection will again defer registering the statement with the server. * Since connections are never restored inside backend transactions, doing * this once at the beginning of your transaction ensures that the statement * will not be re-registered during that transaction. In most cases, however, * it's probably better not to use this and let the connection decide when and * whether to register prepared statements that you've defined. */ void prepare_now(const std::string &name); /** * @} */ /// @deprecated Pre-C++11 transactor function. /** * This has been superseded by the new transactor framework and * @c pqxx::perform. * * Invokes the given transactor, making at most Attempts attempts to perform * the encapsulated code. If the code throws any exception other than * broken_connection, it will be aborted right away. * * @param T The transactor to be executed. * @param Attempts Maximum number of attempts to be made to execute T. */ template PQXX_DEPRECATED void perform(const TRANSACTOR &T, int Attempts); //[t04] /// @deprecated Pre-C++11 transactor function. Use @c pqxx::perform instead. /** * This has been superseded by the new transactor framework and * @c pqxx::perform. * * @param T The transactor to be executed. */ template PQXX_DEPRECATED void perform(const TRANSACTOR &T) { #include "pqxx/internal/ignore-deprecated-pre.hxx" perform(T, 3); #include "pqxx/internal/ignore-deprecated-post.hxx" } /// Suffix unique number to name to make it unique within session context /** Used internally to generate identifiers for SQL objects (such as cursors * and nested transactions) based on a given human-readable base name. */ std::string adorn_name(const std::string &); //[90] /** * @defgroup escaping-functions String-escaping functions */ //@{ /// Escape string for use as SQL string literal on this connection std::string esc(const char str[]); /// Escape string for use as SQL string literal on this connection std::string esc(const char str[], size_t maxlen); /// Escape string for use as SQL string literal on this connection std::string esc(const std::string &str); /// Escape binary string for use as SQL string literal on this connection std::string esc_raw(const unsigned char str[], size_t len); /// Unescape binary data, e.g. from a table field or notification payload. /** Takes a binary string as escaped by PostgreSQL, and returns a restored * copy of the original binary data. */ std::string unesc_raw(const std::string &text) { return unesc_raw(text.c_str()); } /// Unescape binary data, e.g. from a table field or notification payload. /** Takes a binary string as escaped by PostgreSQL, and returns a restored * copy of the original binary data. */ std::string unesc_raw(const char *text); /// Escape and quote a string of binary data. std::string quote_raw(const unsigned char str[], size_t len); /// Escape and quote an SQL identifier for use in a query. std::string quote_name(const std::string &identifier); /// Represent object as SQL string, including quoting & escaping. /** Nulls are recognized and represented as SQL nulls. */ template std::string quote(const T &t) { if (string_traits::is_null(t)) return "NULL"; return "'" + this->esc(to_string(t)) + "'"; } std::string quote(const binarystring &); /// Escape string for literal LIKE match. /** Use this when part of an SQL "LIKE" pattern should match only as a * literal string, not as a pattern, even if it contains "%" or "_" * characters that would normally act as wildcards. * * The string does not get string-escaped or quoted. You do that later. * * For instance, let's say you have a string @c name entered by the user, * and you're searching a @c file column for items that match @c name * followed by a dot and three letters. Even if @c name contains wildcard * characters "%" or "_", you only want those to match literally, so "_" * only matches "_" and "%" only matches a single "%". * * You do that by "like-escaping" @c name, appending the wildcard pattern * @c ".___", and finally, escaping and quoting the result for inclusion in * your query: * * tx.exec( * "SELECT file FROM item WHERE file LIKE " + * tx.quote(tx.esc_like(name) + ".___")); * * The SQL "LIKE" operator also lets you choose your own escape character. * This is supported, but must be a single-byte character. */ std::string esc_like(const std::string &str, char escape_char='\\') const; //@} /// Attempt to cancel the ongoing query, if any. void cancel_query(); /// Error verbosity levels. enum error_verbosity { // These values must match those in libpq's PGVerbosity enum. terse=0, normal=1, verbose=2 }; /// Set session verbosity. /** Set the verbosity of error messages to "terse", "normal" (i.e. default) or * "verbose." * * If "terse", returned messages include severity, primary text, and position * only; this will normally fit on a single line. "normal" produces messages * that include the above plus any detail, hint, or context fields (these * might span multiple lines). "verbose" includes all available fields. */ void set_verbosity(error_verbosity verbosity) noexcept; /// Retrieve current error verbosity error_verbosity get_verbosity() const noexcept {return m_verbosity;} /// Return pointers to the active errorhandlers. /** The entries are ordered from oldest to newest handler. * * You may use this to find errorhandlers that your application wants to * delete when destroying the connection. Be aware, however, that libpqxx * may also add errorhandlers of its own, and those will be included in the * list. If this is a problem for you, derive your errorhandlers from a * custom base class derived from pqxx::errorhandler. Then use dynamic_cast * to find which of the error handlers are yours. * * The pointers point to the real errorhandlers. The container it returns * however is a copy of the one internal to the connection, not a reference. */ std::vector get_errorhandlers() const; protected: explicit connection_base(connectionpolicy &pol) : m_policy{pol} { // Check library version. The check_library_version template is declared // for any library version, but only actually defined for the version of // the libpqxx binary against which the code is linked. // // If the library binary is a different version than the one declared in // these headers, then this call will fail to link: there will be no // definition for the function with these exact template parameter values. // There will be a definition, but the version in the parameter values will // be different. // // There is no particular reason to do this here in this constructor, except // to ensure that every meaningful libpqxx client will execute it. The call // must be in the execution path somewhere or the compiler won't try to link // it. We can't use it to initialise a global or class-static variable, // because a smart compiler might resolve it at compile time. // // On the other hand, we don't want to make a useless function call too // often for performance reasons. A local static variable is initialised // only on the definition's first execution. Compilers will be well // optimised for this behaviour, so there's a minimal one-time cost. static const auto version_ok = internal::check_library_version(); ignore_unused(version_ok); clearcaps(); } void init(); void close() noexcept; void wait_read() const; void wait_read(long seconds, long microseconds) const; void wait_write() const; private: result make_result(internal::pq::PGresult *rhs, const std::string &query); void clearcaps() noexcept; void PQXX_PRIVATE set_up_state(); void PQXX_PRIVATE check_result(const result &); void PQXX_PRIVATE internal_set_trace() noexcept; int PQXX_PRIVATE PQXX_PURE status() const noexcept; friend class internal::gate::const_connection_largeobject; const char * PQXX_PURE err_msg() const noexcept; void PQXX_PRIVATE reset(); std::string PQXX_PRIVATE raw_get_var(const std::string &); void PQXX_PRIVATE process_notice_raw(const char msg[]) noexcept; void read_capabilities(); prepare::internal::prepared_def &find_prepared(const std::string &); prepare::internal::prepared_def ®ister_prepared(const std::string &); friend class internal::gate::connection_prepare_invocation; /// @deprecated Use exec_prepared instead. PQXX_DEPRECATED result prepared_exec( const std::string &, const char *const[], const int[], const int[], int); result exec_prepared(const std::string &statement, const internal::params &); bool prepared_exists(const std::string &) const; /// Connection handle. internal::pq::PGconn *m_conn = nullptr; connectionpolicy &m_policy; /// Active transaction on connection, if any. internal::unique m_trans; /// Set libpq notice processor to call connection's error handlers chain. void set_notice_processor(); /// Clear libpq notice processor. void clear_notice_processor(); std::list m_errorhandlers; /// File to trace to, if any std::FILE *m_trace = nullptr; using receiver_list = std::multimap; /// Notification receivers. receiver_list m_receivers; /// Variables set in this session std::map m_vars; using PSMap = std::map; /// Prepared statements existing in this section PSMap m_prepared; /// Server version int m_serverversion = 0; /// Stacking counter: known objects that can't be auto-reactivated internal::reactivation_avoidance_counter m_reactivation_avoidance; /// Unique number to use as suffix for identifiers (see adorn_name()) int m_unique_id = 0; /// Have we successfully established this connection? bool m_completed = false; /// Is reactivation currently inhibited? bool m_inhibit_reactivation = false; /// Set of session capabilities std::bitset m_caps; /// Current verbosity level error_verbosity m_verbosity = normal; friend class internal::gate::connection_errorhandler; void PQXX_PRIVATE register_errorhandler(errorhandler *); void PQXX_PRIVATE unregister_errorhandler(errorhandler *) noexcept; friend class internal::gate::connection_transaction; result PQXX_PRIVATE exec(const char[], int Retries); void PQXX_PRIVATE register_transaction(transaction_base *); void PQXX_PRIVATE unregister_transaction(transaction_base *) noexcept; bool PQXX_PRIVATE read_copy_line(std::string &); void PQXX_PRIVATE write_copy_line(const std::string &); void PQXX_PRIVATE end_copy_write(); void PQXX_PRIVATE raw_set_var(const std::string &, const std::string &); void PQXX_PRIVATE add_variables(const std::map &); friend class internal::gate::connection_largeobject; internal::pq::PGconn *raw_connection() const { return m_conn; } friend class internal::gate::connection_notification_receiver; void add_receiver(notification_receiver *); void remove_receiver(notification_receiver *) noexcept; friend class internal::gate::connection_pipeline; void PQXX_PRIVATE start_exec(const std::string &); bool PQXX_PRIVATE consume_input() noexcept; bool PQXX_PRIVATE is_busy() const noexcept; internal::pq::PGresult *get_result(); friend class internal::gate::connection_dbtransaction; friend class internal::gate::connection_sql_cursor; void add_reactivation_avoidance_count(int); friend class internal::gate::connection_reactivation_avoidance_exemption; friend class internal::gate::connection_parameterized_invocation; /// @deprecated Use exec_params instead. PQXX_DEPRECATED result parameterized_exec( const std::string &query, const char *const params[], const int paramlengths[], const int binaries[], int nparams); result exec_params( const std::string &query, const internal::params &args); connection_base(const connection_base &) =delete; connection_base &operator=(const connection_base &) =delete; }; namespace internal { /// Scoped exemption to reactivation avoidance class PQXX_LIBEXPORT reactivation_avoidance_exemption { public: explicit reactivation_avoidance_exemption(connection_base &C); ~reactivation_avoidance_exemption(); void close_connection() noexcept { m_open = false; } private: connection_base &m_home; int m_count; bool m_open; }; void wait_read(const internal::pq::PGconn *); void wait_read(const internal::pq::PGconn *, long seconds, long microseconds); void wait_write(const internal::pq::PGconn *); } // namespace pqxx::internal } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/connectionpolicy000066400000000000000000000003101350065432700211410ustar00rootroot00000000000000/** Base connection policy class. * * Interface for defining connection policies */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/connectionpolicy.hxx" libpqxx-6.4.5/include/pqxx/connectionpolicy.hxx000066400000000000000000000025171350065432700217620ustar00rootroot00000000000000/** Definition of the connection policy classes. * * Interface for defining connection policies * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/connection instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_CONNECTIONPOLICY #define PQXX_H_CONNECTIONPOLICY #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include "pqxx/internal/libpq-forward.hxx" namespace pqxx { /** * @addtogroup connection Connection classes */ //@{ class PQXX_LIBEXPORT connectionpolicy { public: using handle = internal::pq::PGconn *; explicit connectionpolicy(const std::string &opts); virtual ~connectionpolicy() noexcept; const std::string &options() const noexcept { return m_options; } virtual handle do_startconnect(handle orig); virtual handle do_completeconnect(handle orig); virtual handle do_dropconnect(handle orig) noexcept; virtual handle do_disconnect(handle orig) noexcept; virtual bool is_ready(handle) const noexcept; protected: handle normalconnect(handle); private: std::string m_options; }; //@} } // namespace #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/cursor000066400000000000000000000003231350065432700171030ustar00rootroot00000000000000/** Definition of the iterator/container-style cursor classes. * * C++-style wrappers for SQL cursors */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/cursor.hxx" libpqxx-6.4.5/include/pqxx/cursor.hxx000066400000000000000000000370421350065432700177210ustar00rootroot00000000000000/** Definition of the iterator/container-style cursor classes. * * C++-style wrappers for SQL cursors * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/cursor instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_CURSOR #define PQXX_H_CURSOR #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include #include "pqxx/result.hxx" #include "pqxx/transaction_base.hxx" namespace pqxx { /// Common definitions for cursor types /** In C++ terms, fetches are always done in pre-increment or pre-decrement * fashion--i.e. the result does not include the row the cursor is on at the * beginning of the fetch, and the cursor ends up being positioned on the last * row in the result. * * There are singular positions akin to @c end() at both the beginning and the * end of the cursor's range of movement, although these fit in so naturally * with the semantics that one rarely notices them. The cursor begins at the * first of these, but any fetch in the forward direction will move the cursor * off this position and onto the first row before returning anything. */ class PQXX_LIBEXPORT cursor_base { public: using size_type = result_size_type; using difference_type = result_difference_type; /// Cursor access-pattern policy /** Allowing a cursor to move forward only can result in better performance, * so use this access policy whenever possible. */ enum accesspolicy { /// Cursor can move forward only forward_only, /// Cursor can move back and forth random_access }; /// Cursor update policy /** * @warning Not all PostgreSQL versions support updatable cursors. */ enum updatepolicy { /// Cursor can be used to read data but not to write read_only, /// Cursor can be used to update data as well as read it update }; /// Cursor destruction policy /** The normal thing to do is to make a cursor object the owner of the SQL * cursor it represents. There may be cases, however, where a cursor needs to * persist beyond the end of the current transaction (and thus also beyond the * lifetime of the cursor object that created it!), where it can be "adopted" * into a new cursor object. See the basic_cursor documentation for an * explanation of cursor adoption. * * If a cursor is created with "loose" ownership policy, the object * representing the underlying SQL cursor will not take the latter with it * when its own lifetime ends, nor will its originating transaction. * * @warning Use this feature with care and moderation. Only one cursor object * should be responsible for any one underlying SQL cursor at any given time. * * @warning Don't "leak" cursors! As long as any "loose" cursor exists, * any attempts to deactivate or reactivate the connection, implicitly or * explicitly, are quietly ignored. */ enum ownershippolicy { /// Destroy SQL cursor when cursor object is closed at end of transaction owned, /// Leave SQL cursor in existence after close of object and transaction loose }; cursor_base() =delete; cursor_base(const cursor_base &) =delete; cursor_base &operator=(const cursor_base &) =delete; /** * @name Special movement distances. */ //@{ /// Special value: read until end. /** @return Maximum value for result::difference_type, so the cursor will * attempt to read the largest possible result set. */ static difference_type all() noexcept; //[t81] /// Special value: read one row only. /** @return Unsurprisingly, 1. */ static difference_type next() noexcept { return 1; } //[t81] /// Special value: read backwards, one row only. /** @return Unsurprisingly, -1. */ static difference_type prior() noexcept { return -1; } //[t00] /// Special value: read backwards from current position back to origin. /** @return Minimum value for result::difference_type. */ static difference_type backward_all() noexcept; //[t00] //@} /// Name of underlying SQL cursor /** * @returns Name of SQL cursor, which may differ from original given name. * @warning Don't use this to access the SQL cursor directly without going * through the provided wrapper classes! */ const std::string &name() const noexcept { return m_name; } //[t81] protected: cursor_base( connection_base &, const std::string &Name, bool embellish_name=true); const std::string m_name; }; } // namespace pqxx #include namespace pqxx { /// "Stateless cursor" class: easy API for retrieving parts of result sets /** This is a front-end for SQL cursors, but with a more C++-like API. * * Actually, stateless_cursor feels entirely different from SQL cursors. You * don't keep track of positions, fetches, and moves; you just say which rows * you want. See the retrieve() member function. */ template class stateless_cursor { public: using size_type = result_size_type; using difference_type = result_difference_type; /// Create cursor. stateless_cursor( transaction_base &trans, const std::string &query, const std::string &cname, bool hold) : m_cur{trans, query, cname, cursor_base::random_access, up, op, hold} { } /// Adopt existing scrolling SQL cursor. stateless_cursor( transaction_base &trans, const std::string adopted_cursor) : m_cur{trans, adopted_cursor, op} { // Put cursor in known position m_cur.move(cursor_base::backward_all()); } void close() noexcept { m_cur.close(); } /// Number of rows in cursor's result set /** @note This function is not const; it may need to scroll to find the size * of the result set. */ size_type size() { return internal::obtain_stateless_cursor_size(m_cur); } /// Retrieve rows from begin_pos (inclusive) to end_pos (exclusive) /** Rows are numbered starting from 0 to size()-1. * * @param begin_pos First row to retrieve. May be one row beyond the end of * the result set, to avoid errors for empty result sets. Otherwise, must be * a valid row number in the result set. * @param end_pos Row up to which to fetch. Rows are returned ordered from * begin_pos to end_pos, i.e. in ascending order if begin_pos < end_pos but * in descending order if begin_pos > end_pos. The end_pos may be arbitrarily * inside or outside the result set; only existing rows are included in the * result. */ result retrieve(difference_type begin_pos, difference_type end_pos) { return internal::stateless_cursor_retrieve( m_cur, result::difference_type(size()), begin_pos, end_pos); } const std::string &name() const noexcept { return m_cur.name(); } private: internal::sql_cursor m_cur; }; class icursor_iterator; namespace internal { namespace gate { class icursor_iterator_icursorstream; class icursorstream_icursor_iterator; } // namespace internal::gate } // namespace internal /// Simple read-only cursor represented as a stream of results /** SQL cursors can be tricky, especially in C++ since the two languages seem to * have been designed on different planets. An SQL cursor has two singular * positions akin to @c end() on either side of the underlying result set. * * These cultural differences are hidden from view somewhat by libpqxx, which * tries to make SQL cursors behave more like familiar C++ entities such as * iterators, sequences, streams, and containers. * * Data is fetched from the cursor as a sequence of result objects. Each of * these will contain the number of rows defined as the stream's stride, except * of course the last block of data which may contain fewer rows. * * This class can create or adopt cursors that live outside any backend * transaction, which your backend version may not support. */ class PQXX_LIBEXPORT icursorstream { public: using size_type = cursor_base::size_type; using difference_type = cursor_base::difference_type; /// Set up a read-only, forward-only cursor /** Roughly equivalent to a C++ Standard Library istream, this cursor type * supports only two operations: reading a block of rows while moving forward, * and moving forward without reading any data. * * @param context Transaction context that this cursor will be active in * @param query SQL query whose results this cursor shall iterate * @param basename Suggested name for the SQL cursor; a unique code will be * appended by the library to ensure its uniqueness * @param sstride Number of rows to fetch per read operation; must be a * positive number */ icursorstream( transaction_base &context, const std::string &query, const std::string &basename, difference_type sstride=1); //[t81] /// Adopt existing SQL cursor. Use with care. /** Forms a cursor stream around an existing SQL cursor, as returned by e.g. a * server-side function. The SQL cursor will be cleaned up by the stream's * destructor as if it had been created by the stream; cleaning it up by hand * or adopting the same cursor twice is an error. * * Passing the name of the cursor as a string is not allowed, both to avoid * confusion with the other constructor and to discourage unnecessary use of * adopted cursors. * * @warning It is technically possible to adopt a "WITH HOLD" cursor, i.e. a * cursor that stays alive outside its creating transaction. However, any * cursor stream (including the underlying SQL cursor, naturally) must be * destroyed before its transaction context object is destroyed. Therefore * the only way to use SQL's WITH HOLD feature is to adopt the cursor, but * defer doing so until after entering the transaction context that will * eventually destroy it. * * @param context Transaction context that this cursor will be active in. * @param cname Result field containing the name of the SQL cursor to adopt. * @param sstride Number of rows to fetch per read operation; must be a * positive number. * @param op Ownership policy. Determines whether the cursor underlying this * stream will be destroyed when the stream is closed. */ icursorstream( transaction_base &context, const field &cname, difference_type sstride=1, cursor_base::ownershippolicy op=cursor_base::owned); //[t84] operator bool() const noexcept { return not m_done; } /// Read new value into given result object; same as operator >> /** The result set may continue any number of rows from zero to the chosen * stride, inclusive. An empty result will only be returned if there are no * more rows to retrieve. * @return Reference to this very stream, to facilitate "chained" invocations * ("C.get(r1).get(r2);") */ icursorstream &get(result &res) { res = fetchblock(); return *this; } //[t81] /// Read new value into given result object; same as get(result &) /** The result set may continue any number of rows from zero to the chosen * stride, inclusive. An empty result will only be returned if there are no * more rows to retrieve. * @return Reference to this very stream, to facilitate "chained" invocations * ("C >> r1 >> r2;") */ icursorstream &operator>>(result &res) { return get(res); } //[t81] /// Move given number of rows forward (ignoring stride) without reading data /** * @return Reference to this very stream, to facilitate "chained" invocations * ("C.ignore(2).get(r).ignore(4);") */ icursorstream &ignore(std::streamsize n=1); //[t81] /// Change stride, i.e. the number of rows to fetch per read operation /** * @param stride Must be a positive number */ void set_stride(difference_type stride); //[t81] difference_type stride() const noexcept { return m_stride; } //[t81] private: result fetchblock(); friend class internal::gate::icursorstream_icursor_iterator; size_type forward(size_type n=1); void insert_iterator(icursor_iterator *) noexcept; void remove_iterator(icursor_iterator *) const noexcept; void service_iterators(difference_type); internal::sql_cursor m_cur; difference_type m_stride; difference_type m_realpos, m_reqpos; mutable icursor_iterator *m_iterators; bool m_done; }; /// Approximate istream_iterator for icursorstream /** Intended as an implementation of an input_iterator (as defined by the C++ * Standard Library), this class supports only two basic operations: reading the * current element, and moving forward. In addition to the minimal guarantees * for istream_iterators, this class supports multiple successive reads of the * same position (the current result set is cached in the iterator) even after * copying and even after new data have been read from the stream. This appears * to be a requirement for input_iterators. Comparisons are also supported in * the general case. * * The iterator does not care about its own position, however. Moving an * iterator forward moves the underlying stream forward and reads the data from * the new stream position, regardless of the iterator's old position in the * stream. * * The stream's stride defines the granularity for all iterator movement or * access operations, i.e. "ici += 1" advances the stream by one stride's worth * of rows, and "*ici++" reads one stride's worth of rows from the stream. * * @warning Do not read from the underlying stream or its cursor, move its read * position, or change its stride, between the time the first icursor_iterator * on it is created and the time its last icursor_iterator is destroyed. * * @warning Manipulating these iterators within the context of a single cursor * stream is not thread-safe. Creating a new iterator, copying one, or * destroying one affects the stream as a whole. */ class PQXX_LIBEXPORT icursor_iterator { public: using iterator_category = std::input_iterator_tag; using value_type = result; using pointer = const result *; using reference = const result &; using istream_type = icursorstream; using size_type = istream_type::size_type; using difference_type = istream_type::difference_type; icursor_iterator() noexcept; //[t84] explicit icursor_iterator(istream_type &) noexcept; //[t84] icursor_iterator(const icursor_iterator &) noexcept; //[t84] ~icursor_iterator() noexcept; const result &operator*() const { refresh(); return m_here; } //[t84] const result *operator->() const { refresh(); return &m_here; } //[t84] icursor_iterator &operator++(); //[t84] icursor_iterator operator++(int); //[t84] icursor_iterator &operator+=(difference_type); //[t84] icursor_iterator &operator=(const icursor_iterator &) noexcept; //[t84] bool operator==(const icursor_iterator &rhs) const; //[t84] bool operator!=(const icursor_iterator &rhs) const noexcept //[t84] { return not operator==(rhs); } bool operator<(const icursor_iterator &rhs) const; //[t84] bool operator>(const icursor_iterator &rhs) const //[t84] { return rhs < *this; } bool operator<=(const icursor_iterator &rhs) const //[t84] { return not (*this > rhs); } bool operator>=(const icursor_iterator &rhs) const //[t84] { return not (*this < rhs); } private: void refresh() const; friend class internal::gate::icursor_iterator_icursorstream; difference_type pos() const noexcept { return m_pos; } void fill(const result &); icursorstream *m_stream = nullptr; result m_here; difference_type m_pos; icursor_iterator *m_prev = nullptr, *m_next = nullptr; }; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/dbtransaction000066400000000000000000000003441350065432700204240ustar00rootroot00000000000000/** pqxx::dbtransaction abstract base class. * * pqxx::dbransaction defines a real transaction on the database. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/dbtransaction.hxx" libpqxx-6.4.5/include/pqxx/dbtransaction.hxx000066400000000000000000000072051350065432700212350ustar00rootroot00000000000000/** Definition of the pqxx::dbtransaction abstract base class. * * pqxx::dbransaction defines a real transaction on the database. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/dbtransaction instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_DBTRANSACTION #define PQXX_H_DBTRANSACTION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/transaction_base.hxx" namespace pqxx { enum readwrite_policy { read_only, read_write }; /// Abstract base class responsible for bracketing a backend transaction. /** * @ingroup transaction * * Use a dbtransaction-derived object such as "work" (transaction<>) to enclose * operations on a database in a single "unit of work." This ensures that the * whole series of operations either succeeds as a whole or fails completely. * In no case will it leave half-finished work behind in the database. * * Once processing on a transaction has succeeded and any changes should be * allowed to become permanent in the database, call commit(). If something * has gone wrong and the changes should be forgotten, call abort() instead. * If you do neither, an implicit abort() is executed at destruction time. * * It is an error to abort a transaction that has already been committed, or to * commit a transaction that has already been aborted. Aborting an already * aborted transaction or committing an already committed one has been allowed * to make errors easier to deal with. Repeated aborts or commits have no * effect after the first one. * * Database transactions are not suitable for guarding long-running processes. * If your transaction code becomes too long or too complex, please consider * ways to break it up into smaller ones. There's no easy, general way to do * this since application-specific considerations become important at this * point. * * The actual operations for beginning and committing/aborting the backend * transaction are implemented by a derived class. The implementing concrete * class must also call Begin() and End() from its constructors and destructors, * respectively, and implement do_exec(). */ class PQXX_LIBEXPORT PQXX_NOVTABLE dbtransaction : public transaction_base { public: virtual ~dbtransaction(); protected: dbtransaction( connection_base &, const std::string &IsolationString, readwrite_policy rw=read_write); explicit dbtransaction( connection_base &, bool direct=true, readwrite_policy rw=read_write); /// Start a transaction on the backend and set desired isolation level void start_backend_transaction(); /// Sensible default implemented here: begin backend transaction virtual void do_begin() override; //[t01] /// Sensible default implemented here: perform query virtual result do_exec(const char Query[]) override; /// To be implemented by derived class: commit backend transaction virtual void do_commit() override =0; /// Sensible default implemented here: abort backend transaction /** Default implementation does two things: *
    *
  1. Clears the "connection reactivation avoidance counter"
  2. *
  3. Executes a ROLLBACK statement
  4. *
*/ virtual void do_abort() override; //[t13] static std::string fullname(const std::string &ttype, const std::string &isolation); private: /// Precomputed SQL command to run at start of this transaction std::string m_start_cmd; }; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/doc/000077500000000000000000000000001350065432700164125ustar00rootroot00000000000000libpqxx-6.4.5/include/pqxx/doc/README.md000066400000000000000000000004471350065432700176760ustar00rootroot00000000000000Documentation headers ===================== These headers are not meant to be included. They are documentation, not code. Keeping them in this form lets the documentation system process them in the same way as in-line documentation, supporting references back and forth between the two kinds. libpqxx-6.4.5/include/pqxx/doc/accessing-results.md000066400000000000000000000041401350065432700223710ustar00rootroot00000000000000Accessing results and result rows {#accessing-results} --------------------------------- Let's say you have a result object. For example, your program may have done: pqxx::result r = w.exec("SELECT * FROM mytable"); Now, how do you access the data inside `r`? Result sets act as standard C++ containers of rows. Rows act as standard C++ containers of fields. So the easiest way to go through them is: for (const auto &row: r) { for (const auto &field: row) std::cout << field.c_str() << '\t'; std::cout << std::endl; } But results and rows also support other kinds of access. Array-style indexing, for instance, such as `r[rownum]`: const int num_rows = r.size(); for (int rownum=0; rownum < num_rows; ++rownum) { const pqxx::row row = r[rownum]; const int num_cols = row.size(); for (int colnum=0; colnum < num_cols; ++colnum) { const pqxx::field field = row[colnum]; std::cout << field.c_str() << '\t'; } std::cout << std::endl; } And of course you can use classic "begin/end" loops: for (auto row = r.begin(); row != r.end(); row++) { for (auto field = row.begin(); field != row.end(); field++) std::cout << field->c_str() << '\t'; std::cout << std::endl; } Result sets are immutable, so all iterators on results and rows are actually `const_iterator`s. There are also `const_reverse_iterator` types, which iterate backwards from `rbegin()` to `rend()` exclusive. All these iterator types provide one extra bit of convenience that you won't normally find in C++ iterators: referential transparency. You don't need to dereference them to get to the row or field they refer to. That is, instead of `row->end()` you can also choose to say `row.end()`. Similarly, you may prefer `field.c_str()` over `field->c_str()`. This becomes really helpful with the array-indexing operator. With regular C++ iterators you would need ugly expressions like `(*row)[0]` or `row->operator[](0)`. With the iterator types defined by the result and row classes you can simply say `row[0]`. libpqxx-6.4.5/include/pqxx/doc/escaping.md000066400000000000000000000051171350065432700205310ustar00rootroot00000000000000String escaping {#escaping} =============== Writing queries as strings is easy. But sometimes you need a variable in there: `"SELECT id FROM user WHERE name = '" + name + "'"`. This is dangerous. See the bug? If `name` can contain quotes, you may have an SQL injection vulnerability there, where users can enter nasty stuff like "`.'; DROP TABLE user`". Or if you're lucky, it's just a nasty bug that you discover when `name` happens to be "d'Arcy". So, you'll need to _escape_ the `name` before you insert it. This is where quotes and other problematic characters are marked as "this is just a character in the string, not the end of the string." There are [several functions](@ref escaping-functions) in libpqxx to do this for you. SQL injection ------------- To understand what SQL injection vulnerabilities are and why they should be prevented, imagine you use the following SQL statement somewhere in your program: TX.exec( "SELECT number,amount " "FROM accounts " "WHERE allowed_to_see('" + userid + "','" + password + "')"); This shows a logged-in user important information on all accounts he is authorized to view. The userid and password strings are variables entered by the user himself. Now, if the user is actually an attacker who knows (or can guess) the general shape of this SQL statement, imagine he enters the following password: x') OR ('x' = 'x Does that make sense to you? Probably not. But if this is inserted into the SQL string by the C++ code above, the query becomes: SELECT number,amount FROM accounts WHERE allowed_to_see('user','x') OR ('x' = 'x') Is this what you wanted to happen? Probably not! The neat `allowed_to_see()` clause is completely circumvented by the "`OR ('x' = 'x')`" clause, which is always `true`. Therefore, the attacker will get to see all accounts in the database! Using the esc functions ----------------------- Here's how you can fix the problem in the example above: TX.exec( "SELECT number,amount " "FROM accounts " "WHERE allowed_to_see('" + TX.esc(userid) + "', " "'" + TX.esc(password) + "')"); Now, the quotes embedded in the attacker's string will be neatly escaped so they can't "break out" of the quoted SQL string they were meant to go into: SELECT number,amount FROM accounts WHERE allowed_to_see('user', 'x'') OR (''x'' = ''x') If you look carefully, you'll see that thanks to the added escape characters (a single-quote is escaped in SQL by doubling it) all we get is a very strange-looking password string--but not a change in the SQL statement. libpqxx-6.4.5/include/pqxx/doc/getting-started.md000066400000000000000000000116221350065432700220430ustar00rootroot00000000000000Getting started {#getting-started} =============== The most basic three types in libpqxx are the _connection_, the _transaction_, and the _result_. They fit together as follows: * You connect to the database by creating a connection object (see @ref connection). The connection type you'll usually want is `pqxx::connection`. * You create a transaction object (see @ref transaction) operating on that connection. You'll usually want the `pqxx::work` variety. Once you're done you call the transaction's `commit` function to make its work final. If you don't call this, the work will be rolled back when the transaction object is destroyed. * Until then, use the transaction's `exec` functions to execute queries, which you pass in as simple strings. * Most of the `exec` functions return a `pqxx::result` object, which acts as a standard container of rows. Each row in a result, in turn, acts as a container of fields. You can use array indexing or iterators to access either. * The field's data is stored internally as a text string. You can read it as such using its `c_str` function, or convert it to other types using its `as` and `to` member functions. These are templated on the destination type: `myfield.as();` or `myfield.to(myint);` * After you've closed the transaction, the connection is free to run a next transaction. Here's a very basic example. It connects to the default database (you'll need to have one set up), queries it for a very simple result, converts it to an `int`, and prints it out. It also contains some basic error handling. #include #include int main() { try { // Connect to the database. In practice we may have to pass some // arguments to say where the database server is, and so on. // The constructor parses options exactly like libpq's // PQconnectdb/PQconnect, see: // https://www.postgresql.org/docs/10/static/libpq-connect.html pqxx::connection c; // Start a transaction. In libpqxx, you always work in one. pqxx::work w(c); // work::exec1() executes a query returning a single row of data. // We'll just ask the database to return the number 1 to us. pqxx::row r = w.exec1("SELECT 1"); // Commit your transaction. If an exception occurred before this // point, execution will have left the block, and the transaction will // have been destroyed along the way. In that case, the failed // transaction would implicitly abort instead of getting to this point. w.commit(); // Look at the first and only field in the row, parse it as an integer, // and print it. std::cout << r[0].as() << std::endl; } catch (const std::exception &e) { std::cerr << e.what() << std::endl; return 1; } } This prints the number 1. Notice that you can keep the result object around after the transaction (or even the connection) has been closed. There are situations where you can't do it, but generally it's fine. If you're interested: you can install your own callbacks for receiving error messages from the database, and in that case you'll have to keep the connection object alive. But otherwise, it's nice to be able to "fire and forget" your connection and deal with the data. Here's a slightly more complicated example. It takes an argument from the command line and retrieves a string with that value. The interesting part is that it uses the escaping-and-quoting function `quote` to embed this string value in SQL safely. It also reads the result field's value as a plain C-style string using its `c_str` function. #include #include #include int main(int argc, char *argv[]) { try { if (!argv[1]) throw std::runtime_error("Give me a string!"); pqxx::connection c; pqxx::work w(c); // work::exec() returns a full result set, which can consist of any // number of rows. pqxx::result r = w.exec("SELECT " + w.quote(argv[1])); // End our transaction here. We can still use the result afterwards. w.commit(); // Print the first field of the first row. Read it as a C string, // just like std::string::c_str() does. std::cout << r[0][0].c_str() << std::endl; } catch (const std::exception &e) { std::cerr << e.what() << std::endl; return 1; } } You can find more about converting field values to native types, or converting values to strings for use with libpqxx, under @ref stringconversion. More about getting to the rows and fields of a result is under @ref accessing-results. If you want to handle exceptions thrown by libpqxx in more detail, for example to print the SQL contents of a query that failed, see @ref exception. libpqxx-6.4.5/include/pqxx/doc/mainpage.md000066400000000000000000000014461350065432700205220ustar00rootroot00000000000000libpqxx {#mainpage} ======= @author Jeroen T. Vermeulen @see http://pqxx.org @see https://github.com/jtv/libpqxx Welcome to libpqxx, the C++ API to the PostgreSQL database management system. Compiling this package requires PostgreSQL to be installed -- including the C headers for client development. The library builds on top of PostgreSQL's standard C API, libpq. The libpq headers are not needed to compile client programs, however. For a quick introduction to installing and using libpqxx, see the README.md file. The latest information can be found at http://pqxx.org/ Some links that should help you find your bearings: * @ref getting-started * @ref thread-safety * @ref connection * @ref transaction * @ref escaping * @ref performance * @ref transactor libpqxx-6.4.5/include/pqxx/doc/performance.md000066400000000000000000000015251350065432700212400ustar00rootroot00000000000000Performance features {#performance} ==================== If your program's database interaction is not as efficient as it needs to be, the first place to look is usually the SQL you're executing. But libpqxx has a few specialized features to help you squeeze more performance out of how you issue commands and retrieve data: * @ref streams. Use these as a faster way to transfer data between your code and the database. * @ref prepared. These can be executed many times without the server parsing and planning them each and every time. They also save you having to escape string parameters. * pqxx::pipeline lets you send queries to the database in batch, and continue other processing while they are executing. As always of course, don't risk the quality of your code for optimizations that you don't need! libpqxx-6.4.5/include/pqxx/doc/prepared-statement.md000066400000000000000000000103071350065432700225410ustar00rootroot00000000000000Prepared statements {#prepared} =================== Prepared statements are SQL queries that you define once and then invoke as many times as you like, typically with varying parameters. It's basically a function that you can define ad hoc. If you have an SQL statement that you're going to execute many times in quick succession, it may be more efficient to prepare it once and reuse it. This saves the database backend the effort of parsing complex SQL and figuring out an efficient execution plan. Another nice side effect is that you don't need to worry about escaping parameters. You create a prepared statement by preparing it on the connection (using the `pqxx::connection_base::prepare` functions), passing an identifier and its SQL text. The identifier is the name by which the prepared statement will be known; it should consist of ASCII letters, digits, and underscores only, and start with an ASCII letter. The name is case-sensitive. void prepare_my_statement(pqxx::connection_base &c) { c.prepare( "my_statement", "SELECT * FROM Employee WHERE name = 'Xavier'"); } Once you've done this, you'll be able to call `my_statement` from any transaction you execute on the same connection. For this, use the `pqxx::transaction_base::exec_prepared` functions. pqxx::result execute_my_statement(pqxx::transaction_base &t) { return t.exec_prepared("my_statement"); } Did I mention that prepared statements can have parameters? The query text can contain `$1`, `$2` etc. as placeholders for parameter values that you will provide when you invoke the prepared satement. void prepare_find(pqxx::connection_base &c) { // Prepare a statement called "find" that looks for employees with a // given name (parameter 1) whose salary exceeds a given number // (parameter 2). c.prepare( "find", "SELECT * FROM Employee WHERE name = $1 AND salary > $2"); } This example looks up the prepared statement "find," passes `name` and `min_salary` as parameters, and invokes the statement with those values: pqxx::result execute_find( pqxx::transaction_base &t, std::string name, int min_salary) { return t.exec_prepared("find", name, min_salary); } There is one special case: the _nameless_ prepared statement. You may prepare a statement without a name, i.e. whose name is an empty string. The unnamed statement can be redefined at any time, without un-preparing it first. Never try to prepare, execute, or unprepare a prepared statement manually using direct SQL queries. Always use the functions provided by libpqxx. Prepared statements are not necessarily defined on the backend right away. It's usually done lazily. This means that you can prepare statements before the connection is fully established, and that it's relatively cheap to pre-prepare lots of statements that you may or may not not use during the session. On the other hand, it also means that errors in a prepared statement may not show up until you first try to invoke it. Such an error may then break the transaction it occurs in. A performance note: There are cases where prepared statements are actually slower than plain SQL. Sometimes the backend can produce a better execution plan when it knows the parameter values. For example, say you've got a web application and you're querying for users with status "inactive" who have email addresses in a given domain name X. If X is a very popular provider, the best way for the database engine to plan the query may be to list the inactive users first and then filter for the email addresses you're looking for. But in other cases, it may be much faster to find matching email addresses first and then see which of their owners are "inactive." A prepared statement must be planned to fit either case, but a direct query will be optimised based on table statistics, partial indexes, etc. @warning Beware of "nul" bytes. Any string you pass as a parameter will end at the first char with value zero. If you pass a `std::string` that contains a zero byte, the last byte in the value will be the one just before the zero. If you need a zero byte, consider using pqxx::binarystring and/or SQL's `bytea` type. libpqxx-6.4.5/include/pqxx/doc/streams.md000066400000000000000000000044441350065432700204200ustar00rootroot00000000000000Streams {#streams} ======= Most of the time it's fine to retrieve data from the database using `SELECT` queries, and store data using `INSERT`. But for those cases where efficiency matters, there are two classes to help you do this better: `stream_from` and `stream_to`. They're less flexible than SQL queries, but you get speed and memory efficiencies in return. `stream_from` ------------- Use `stream_from` to read data directly from a database table. It's likely to be faster than a `SELECT`, but also, you won't need to keep your full result set in memory. That can really matter with larger data sets. So, use `stream_from` when you need to... * read all rows in a table, * in an arbitrary order, * without any computation done on them. You can select which _columns_ you want though, and in which order. Every row is converted to a tuple type of your choice as you read it. You stream into the tuple: pqxx::stream_from stream{ tx, "score", std::vector{"name", "points"}}; std::tuple row; while (stream >> row) process(row); stream.complete(); As the stream reads each row, it converts that row's data to your tuple, and then promptly forgets it. This means you can easily read more data than will fit in memory. `stream_to` ----------- Use `stream_to` to write data directly to a database table. This saves you having to perform an `INSERT` for every row, and so it can be significantly faster for larger insertions. As with `stream_from`, you can specify the table and the columns, and not much else. You insert tuple-like objects of your choice: pqxx::stream_to stream{ tx, "score", std::vector{"name", "points"}}; for (const auto &entry: scores) stream << entry; stream.complete(); Each row is processed as you provide it, and not retained in memory after that. The call to `complete()` is more important here than it is for `stream_from`. It's a lot like a "commit" or "abort" at the end of a transaction. If you omit it, it will be done automatically during the stream's destructor. But since destructors can't throw exceptions, any failures at that stage won't be visible in your code. So, always call `complete()` on a `stream_to` to close it off properly! libpqxx-6.4.5/include/pqxx/doc/thread-safety.md000066400000000000000000000025531350065432700215010ustar00rootroot00000000000000Thread safety {#thread-safety} ============= This library does not contain any locking code to protect objects against simultaneous modification in multi-threaded programs. Therefore it is up to you, the user of the library, to ensure that your threaded client programs perform no conflicting operations concurrently. Most of the time this isn't hard. Result sets are immutable, so you can share them between threads without problem. The main rule is: @li Treat a connection, together with any and all objects related to it, as a "world" of its own. You should generally make sure that the same "world" is never accessed by another thread while you're doing anything non-const in there. That means: don't issue a query on a transaction while you're also opening a subtransaction, don't access a cursor while you may also be committing, and so on. In particular, cursors are tricky. It's easy to perform a non-const operation without noticing. So, if you're going to share cursors or cursor-related objects between threads, lock very conservatively! Use `pqxx::describe_thread_safety` to find out at runtime what level of thread safety is implemented in your build and version of libpqxx. It returns a `pqxx::thread_safety_model` describing what you can and cannot rely on. A command-line utility `tools/pqxxthreadsafety` prints out the same information. libpqxx-6.4.5/include/pqxx/errorhandler000066400000000000000000000003011350065432700202510ustar00rootroot00000000000000/** pqxx::errorhandler class. * * Callbacks for handling errors and warnings. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/errorhandler.hxx" libpqxx-6.4.5/include/pqxx/errorhandler.hxx000066400000000000000000000051751350065432700210750ustar00rootroot00000000000000/** Definition of the pqxx::errorhandler class. * * pqxx::errorhandler handlers errors and warnings in a database session. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/connection_base instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_ERRORHANDLER #define PQXX_H_ERRORHANDLER #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/types.hxx" namespace pqxx { namespace internal { namespace gate { class errorhandler_connection_base; } } /** * @addtogroup errorhandler * @{ */ /// Base class for error-handler callbacks. /** To receive errors and warnings from a connection, subclass this with your * own error-handler functor, and instantiate it for the connection. Destroying * the handler un-registers it. * * A connection can have multiple error handlers at the same time. When the * database connection emits an error or warning message, it passes the message * to each error handler, starting with the most recently registered one and * progressing towards the oldest one. However an error handler may also * instruct the connection not to pass the message to further handlers by * returning "false." * * @warning Strange things happen when a result object outlives its parent * connection. If you register an error handler on a connection, then you must * not access the result after destroying the connection. This applies even if * you destroy the error handler first! */ class PQXX_LIBEXPORT errorhandler { public: explicit errorhandler(connection_base &); virtual ~errorhandler(); /// Define in subclass: receive an error or warning message from the database. /** * @return Whether the same error message should also be passed to the * remaining, older errorhandlers. */ virtual bool operator()(const char msg[]) noexcept =0; private: connection_base *m_home; friend class internal::gate::errorhandler_connection_base; void unregister() noexcept; errorhandler() =delete; errorhandler(const errorhandler &) =delete; errorhandler &operator=(const errorhandler &) =delete; }; /// An error handler that suppresses any previously registered error handlers. class quiet_errorhandler : public errorhandler { public: quiet_errorhandler(connection_base &conn) : errorhandler{conn} {} virtual bool operator()(const char[]) noexcept override { return false; } }; /** * @} */ } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/except000066400000000000000000000003241350065432700170570ustar00rootroot00000000000000/** libpqxx exception classes. * * pqxx::sql_error, pqxx::broken_connection, pqxx::in_doubt_error, ... */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/except.hxx" libpqxx-6.4.5/include/pqxx/except.hxx000066400000000000000000000340431350065432700176720ustar00rootroot00000000000000/** Definition of libpqxx exception classes. * * pqxx::sql_error, pqxx::broken_connection, pqxx::in_doubt_error, ... * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/except instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_EXCEPT #define PQXX_H_EXCEPT #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include "pqxx/util.hxx" namespace pqxx { /** * @addtogroup exception Exception classes * * These exception classes follow, roughly, the two-level hierarchy defined by * the PostgreSQL error codes (see Appendix A of the PostgreSQL documentation * corresponding to your server version). The hierarchy given here is, as yet, * not a complete mirror of the error codes. There are some other differences * as well, e.g. the error code statement_completion_unknown has a separate * status in libpqxx as in_doubt_error, and too_many_connections is classified * as a broken_connection rather than a subtype of insufficient_resources. * * @see http://www.postgresql.org/docs/9.4/interactive/errcodes-appendix.html * * @{ */ /// Mixin base class to identify libpqxx-specific exception types /** * If you wish to catch all exception types specific to libpqxx for some reason, * catch this type. All of libpqxx's exception classes are derived from it * through multiple-inheritance (they also fit into the standard library's * exception hierarchy in more fitting places). * * This class is not derived from std::exception, since that could easily lead * to exception classes with multiple std::exception base-class objects. As * Bart Samwel points out, "catch" is subject to some nasty fineprint in such * cases. */ class PQXX_LIBEXPORT PQXX_NOVTABLE pqxx_exception { public: /// Support run-time polymorphism, and keep this class abstract virtual ~pqxx_exception() noexcept =0; /// Return std::exception base-class object /** Use this to get at the exception's what() function, or to downcast to a * more specific type using dynamic_cast. * * Casting directly from pqxx_exception to a specific exception type is not * likely to work since pqxx_exception is not (and could not safely be) * derived from std::exception. * * For example, to test dynamically whether an exception is an sql_error: * * @code * try * { * // ... * } * catch (const pqxx::pqxx_exception &e) * { * std::cerr << e.base().what() << std::endl; * const pqxx::sql_error *s=dynamic_cast(&e.base()); * if (s) std::cerr << "Query was: " << s->query() << std::endl; * } * @endcode */ PQXX_CONST virtual const std::exception &base() const noexcept =0; //[t00] }; /// Run-time failure encountered by libpqxx, similar to std::runtime_error class PQXX_LIBEXPORT failure : public pqxx_exception, public std::runtime_error { virtual const std::exception &base() const noexcept override { return *this; } public: explicit failure(const std::string &); }; /// Exception class for lost or failed backend connection. /** * @warning When this happens on Unix-like systems, you may also get a SIGPIPE * signal. That signal aborts the program by default, so if you wish to be able * to continue after a connection breaks, be sure to disarm this signal. * * If you're working on a Unix-like system, see the manual page for * @c signal (2) on how to deal with SIGPIPE. The easiest way to make this * signal harmless is to make your program ignore it: * * @code * #include * * int main() * { * signal(SIGPIPE, SIG_IGN); * // ... * @endcode */ class PQXX_LIBEXPORT broken_connection : public failure { public: broken_connection(); explicit broken_connection(const std::string &); }; /// Exception class for failed queries. /** Carries, in addition to a regular error message, a copy of the failed query * and (if available) the SQLSTATE value accompanying the error. */ class PQXX_LIBEXPORT sql_error : public failure { /// Query string. Empty if unknown. const std::string m_query; /// SQLSTATE string describing the error type, if known; or empty string. const std::string m_sqlstate; public: explicit sql_error( const std::string &msg="", const std::string &Q="", const char sqlstate[]=nullptr); virtual ~sql_error() noexcept; /// The query whose execution triggered the exception PQXX_PURE const std::string &query() const noexcept; //[t56] /// SQLSTATE error code if known, or empty string otherwise. PQXX_PURE const std::string &sqlstate() const noexcept; }; /// "Help, I don't know whether transaction was committed successfully!" /** Exception that might be thrown in rare cases where the connection to the * database is lost while finishing a database transaction, and there's no way * of telling whether it was actually executed by the backend. In this case * the database is left in an indeterminate (but consistent) state, and only * manual inspection will tell which is the case. */ class PQXX_LIBEXPORT in_doubt_error : public failure { public: explicit in_doubt_error(const std::string &); }; /// The backend saw itself forced to roll back the ongoing transaction. class PQXX_LIBEXPORT transaction_rollback : public failure { public: explicit transaction_rollback(const std::string &); }; /// Transaction failed to serialize. Please retry it. /** Can only happen at transaction isolation levels REPEATABLE READ and * SERIALIZABLE. * * The current transaction cannot be committed without violating the guarantees * made by its isolation level. This is the effect of a conflict with another * ongoing transaction. The transaction may still succeed if you try to * perform it again. */ class PQXX_LIBEXPORT serialization_failure : public transaction_rollback { public: explicit serialization_failure(const std::string &); }; /// We can't tell whether our last statement succeeded. class PQXX_LIBEXPORT statement_completion_unknown : public transaction_rollback { public: explicit statement_completion_unknown(const std::string &); }; /// The ongoing transaction has deadlocked. Retrying it may help. class PQXX_LIBEXPORT deadlock_detected : public transaction_rollback { public: explicit deadlock_detected(const std::string &); }; /// Internal error in libpqxx library class PQXX_LIBEXPORT internal_error : public pqxx_exception, public std::logic_error { virtual const std::exception &base() const noexcept override { return *this; } public: explicit internal_error(const std::string &); }; /// Error in usage of libpqxx library, similar to std::logic_error class PQXX_LIBEXPORT usage_error : public pqxx_exception, public std::logic_error { virtual const std::exception &base() const noexcept override { return *this; } public: explicit usage_error(const std::string &); }; /// Invalid argument passed to libpqxx, similar to std::invalid_argument class PQXX_LIBEXPORT argument_error : public pqxx_exception, public std::invalid_argument { virtual const std::exception &base() const noexcept override { return *this; } public: explicit argument_error(const std::string &); }; /// Value conversion failed, e.g. when converting "Hello" to int. class PQXX_LIBEXPORT conversion_error : public pqxx_exception, public std::domain_error { virtual const std::exception &base() const noexcept override { return *this; } public: explicit conversion_error(const std::string &); }; /// Something is out of range, similar to std::out_of_range class PQXX_LIBEXPORT range_error : public pqxx_exception, public std::out_of_range { virtual const std::exception &base() const noexcept override { return *this; } public: explicit range_error(const std::string &); }; /// Query returned an unexpected number of rows. class PQXX_LIBEXPORT unexpected_rows : public range_error { virtual const std::exception &base() const noexcept override { return *this; } public: explicit unexpected_rows(const std::string &msg) : range_error{msg} {} }; /// Database feature not supported in current setup class PQXX_LIBEXPORT feature_not_supported : public sql_error { public: explicit feature_not_supported( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; /// Error in data provided to SQL statement class PQXX_LIBEXPORT data_exception : public sql_error { public: explicit data_exception( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT integrity_constraint_violation : public sql_error { public: explicit integrity_constraint_violation( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT restrict_violation : public integrity_constraint_violation { public: explicit restrict_violation( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : integrity_constraint_violation{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT not_null_violation : public integrity_constraint_violation { public: explicit not_null_violation( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : integrity_constraint_violation{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT foreign_key_violation : public integrity_constraint_violation { public: explicit foreign_key_violation( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : integrity_constraint_violation{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT unique_violation : public integrity_constraint_violation { public: explicit unique_violation( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : integrity_constraint_violation{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT check_violation : public integrity_constraint_violation { public: explicit check_violation( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : integrity_constraint_violation{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT invalid_cursor_state : public sql_error { public: explicit invalid_cursor_state( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT invalid_sql_statement_name : public sql_error { public: explicit invalid_sql_statement_name( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT invalid_cursor_name : public sql_error { public: explicit invalid_cursor_name( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT syntax_error : public sql_error { public: /// Approximate position in string where error occurred, or -1 if unknown. const int error_position; explicit syntax_error( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr, int pos=-1) : sql_error{err, Q, sqlstate}, error_position{pos} {} }; class PQXX_LIBEXPORT undefined_column : public syntax_error { public: explicit undefined_column( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : syntax_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT undefined_function : public syntax_error { public: explicit undefined_function( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : syntax_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT undefined_table : public syntax_error { public: explicit undefined_table( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : syntax_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT insufficient_privilege : public sql_error { public: explicit insufficient_privilege( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; /// Resource shortage on the server class PQXX_LIBEXPORT insufficient_resources : public sql_error { public: explicit insufficient_resources( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err,Q, sqlstate} {} }; class PQXX_LIBEXPORT disk_full : public insufficient_resources { public: explicit disk_full( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : insufficient_resources{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT out_of_memory : public insufficient_resources { public: explicit out_of_memory( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : insufficient_resources{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT too_many_connections : public broken_connection { public: explicit too_many_connections(const std::string &err) : broken_connection{err} {} }; /// PL/pgSQL error /** Exceptions derived from this class are errors from PL/pgSQL procedures. */ class PQXX_LIBEXPORT plpgsql_error : public sql_error { public: explicit plpgsql_error( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : sql_error{err, Q, sqlstate} {} }; /// Exception raised in PL/pgSQL procedure class PQXX_LIBEXPORT plpgsql_raise : public plpgsql_error { public: explicit plpgsql_raise( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : plpgsql_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT plpgsql_no_data_found : public plpgsql_error { public: explicit plpgsql_no_data_found( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : plpgsql_error{err, Q, sqlstate} {} }; class PQXX_LIBEXPORT plpgsql_too_many_rows : public plpgsql_error { public: explicit plpgsql_too_many_rows( const std::string &err, const std::string &Q="", const char sqlstate[]=nullptr) : plpgsql_error{err, Q, sqlstate} {} }; /** * @} */ } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/field000066400000000000000000000002701350065432700166520ustar00rootroot00000000000000/** pqxx::field class. * * pqxx::field refers to a field in a query result. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/field.hxx" libpqxx-6.4.5/include/pqxx/field.hxx000066400000000000000000000264501350065432700174700ustar00rootroot00000000000000/** Definitions for the pqxx::field class. * * pqxx::field refers to a field in a query result. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/field instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_FIELD #define PQXX_H_FIELD #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/internal/type_utils.hxx" #if defined(PQXX_HAVE_OPTIONAL) #include /* Use std::experimental::optional as a fallback for std::optional, if * present. * * This may break compilation for some software, if using a libpqxx that was * configured for a different language version. To stop libpqxx headers from * using or supporting std::experimental::optional, define a macro * PQXX_HIDE_EXP_OPTIONAL when building your software. */ #elif defined(PQXX_HAVE_EXP_OPTIONAL) && !defined(PQXX_HIDE_EXP_OPTIONAL) #include #endif #include "pqxx/array.hxx" #include "pqxx/result.hxx" #include "pqxx/strconv.hxx" #include "pqxx/types.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { /// Reference to a field in a result set. /** A field represents one entry in a row. It represents an actual value * in the result set, and can be converted to various types. */ class PQXX_LIBEXPORT field { public: using size_type = field_size_type; /// Constructor. /** Create field as reference to a field in a result set. * @param R Row that this field is part of. * @param C Column number of this field. */ field(const row &R, row_size_type C) noexcept; //[t01] /** * @name Comparison */ //@{ /// Byte-by-byte comparison of two fields (all nulls are considered equal) /** @warning null handling is still open to discussion and change! * * Handling of null values differs from that in SQL where a comparison * involving a null value yields null, so nulls are never considered equal * to one another or even to themselves. * * Null handling also probably differs from the closest equivalent in C++, * which is the NaN (Not-a-Number) value, a singularity comparable to * SQL's null. This is because the builtin == operator demands that a == a. * * The usefulness of this operator is questionable. No interpretation * whatsoever is imposed on the data; 0 and 0.0 are considered different, * as are null vs. the empty string, or even different (but possibly * equivalent and equally valid) encodings of the same Unicode character * etc. */ bool operator==(const field &) const; //[t75] /// Byte-by-byte comparison (all nulls are considered equal) /** @warning See operator==() for important information about this operator */ bool operator!=(const field &rhs) const //[t82] {return not operator==(rhs);} //@} /** * @name Column information */ //@{ /// Column name const char *name() const; //[t11] /// Column type oid type() const; //[t07] /// What table did this column come from? oid table() const; //[t02] row_size_type num() const { return col(); } //[t82] /// What column number in its originating table did this column come from? row_size_type table_column() const; //[t93] //@} /** * @name Content access */ //@{ /// Read as plain C string /** Since the field's data is stored internally in the form of a * zero-terminated C string, this is the fastest way to read it. Use the * to() or as() functions to convert the string to other types such as * @c int, or to C++ strings. */ const char *c_str() const; //[t02] /// Is this field's value null? bool is_null() const noexcept; //[t12] /// Return number of bytes taken up by the field's value. /** * Includes the terminating zero byte. */ size_type size() const noexcept; //[t11] /// Read value into Obj; or leave Obj untouched and return @c false if null /** Note this can be used with optional types (except pointers other than * C-strings) */ template auto to(T &Obj) const //[t03] -> typename std::enable_if<( not std::is_pointer::value or std::is_same::value ), bool>::type { const char *const bytes = c_str(); if (bytes[0] == '\0' and is_null()) return false; from_string(bytes, Obj); return true; } /// Read value into Obj; or leave Obj untouched and return @c false if null template bool operator>>(T &Obj) const //[t07] { return to(Obj); } /// Read value into Obj; or use Default & return @c false if null /** Note this can be used with optional types (except pointers other than * C-strings) */ template auto to(T &Obj, const T &Default) const //[t12] -> typename std::enable_if<( not std::is_pointer::value or std::is_same::value ), bool>::type { const bool NotNull = to(Obj); if (not NotNull) Obj = Default; return NotNull; } /// Return value as object of given type, or Default if null /** Note that unless the function is instantiated with an explicit template * argument, the Default value's type also determines the result type. */ template T as(const T &Default) const //[t01] { T Obj; to(Obj, Default); return Obj; } /// Return value as object of given type, or throw exception if null /** Use as `as>()` or `as()` as * an alternative to `get()`; this is disabled for use with raw pointers * (other than C-strings) because storage for the value can't safely be * allocated here */ template T as() const //[t45] { T Obj; if (not to(Obj)) Obj = string_traits::null(); return Obj; } /// Return value wrapped in some optional type (empty for nulls) /** Use as `get()` as before to obtain previous behavior (i.e. only * usable when `std::optional` or `std::experimental::optional` are * available), or specify container type with `get()` */ template class O #if defined(PQXX_HAVE_OPTIONAL) = std::optional #elif defined(PQXX_HAVE_EXP_OPTIONAL) && !defined(PQXX_HIDE_EXP_OPTIONAL) = std::experimental::optional #endif > constexpr O get() const { return as>(); } /// Parse the field as an SQL array. /** Call the parser to retrieve values (and structure) from the array. * * Make sure the @c result object stays alive until parsing is finished. If * you keep the @c row of @c field object alive, it will keep the @c result * object alive as well. */ array_parser as_array() const { return array_parser{c_str(), m_home.m_encoding}; } //@} protected: const result &home() const noexcept { return m_home; } size_t idx() const noexcept { return m_row; } row_size_type col() const noexcept { return row_size_type(m_col); } /** * You'd expect this to be a size_t, but due to the way reverse iterators * are related to regular iterators, it must be allowed to underflow to -1. */ long m_col; private: result m_home; size_t m_row; }; /// Specialization: to(string &). template<> inline bool field::to(std::string &Obj) const { const char *const bytes = c_str(); if (bytes[0] == '\0' and is_null()) return false; Obj = std::string{bytes, size()}; return true; } /// Specialization: to(const char *&). /** The buffer has the same lifetime as the data in this result (i.e. of this * result object, or the last remaining one copied from it etc.), so take care * not to use it after the last result object referring to this query result is * destroyed. */ template<> inline bool field::to(const char *&Obj) const { if (is_null()) return false; Obj = c_str(); return true; } template> class field_streambuf : public std::basic_streambuf { public: using char_type = CHAR; using traits_type = TRAITS; using int_type = typename traits_type::int_type; using pos_type = typename traits_type::pos_type; using off_type = typename traits_type::off_type; using openmode = std::ios::openmode; using seekdir = std::ios::seekdir; explicit field_streambuf(const field &F) : //[t74] m_field{F} { initialize(); } protected: virtual int sync() override { return traits_type::eof(); } protected: virtual pos_type seekoff(off_type, seekdir, openmode) override { return traits_type::eof(); } virtual pos_type seekpos(pos_type, openmode) override {return traits_type::eof();} virtual int_type overflow(int_type) override { return traits_type::eof(); } virtual int_type underflow() override { return traits_type::eof(); } private: const field &m_field; int_type initialize() { char_type *G = reinterpret_cast(const_cast(m_field.c_str())); this->setg(G, G, G + m_field.size()); return int_type(m_field.size()); } }; /// Input stream that gets its data from a result field /** Use this class exactly as you would any other istream to read data from a * field. All formatting and streaming operations of @c std::istream are * supported. What you'll typically want to use, however, is the fieldstream * alias (which defines a basic_fieldstream for @c char). This is similar to * how e.g. @c std::ifstream relates to @c std::basic_ifstream. * * This class has only been tested for the char type (and its default traits). */ template> class basic_fieldstream : public std::basic_istream { using super = std::basic_istream; public: using char_type = CHAR; using traits_type = TRAITS; using int_type = typename traits_type::int_type; using pos_type = typename traits_type::pos_type; using off_type = typename traits_type::off_type; basic_fieldstream(const field &F) : super{nullptr}, m_buf{F} { super::init(&m_buf); } private: field_streambuf m_buf; }; using fieldstream = basic_fieldstream; /// Write a result field to any type of stream /** This can be convenient when writing a field to an output stream. More * importantly, it lets you write a field to e.g. a @c stringstream which you * can then use to read, format and convert the field in ways that to() does not * support. * * Example: parse a field into a variable of the nonstandard * "long long" type. * * @code * extern result R; * long long L; * stringstream S; * * // Write field's string into S * S << R[0][0]; * * // Parse contents of S into L * S >> L; * @endcode */ template inline std::basic_ostream &operator<<( std::basic_ostream &S, const field &F) //[t46] { S.write(F.c_str(), std::streamsize(F.size())); return S; } /// Convert a field's string contents to another type. template inline void from_string(const field &F, T &Obj) //[t46] { from_string(F.c_str(), Obj, F.size()); } /// Convert a field to a string. template<> PQXX_LIBEXPORT std::string to_string(const field &Obj); //[t74] } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/internal/000077500000000000000000000000001350065432700174615ustar00rootroot00000000000000libpqxx-6.4.5/include/pqxx/internal/callgate.hxx000066400000000000000000000044051350065432700217710ustar00rootroot00000000000000#ifndef PQXX_H_CALLGATE #define PQXX_H_CALLGATE /* Here's what a typical gate class definition looks like: #include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE @gateclass@ : callgate<@host@> { friend class @client@; @gateclass@(reference x) : super(x) {} // Methods here. Use home() to access the host-class object. }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx */ namespace pqxx { namespace internal { /// Base class for call gates. /** * A call gate defines a limited, private interface on the host class that * specified client classes can access. * * The metaphor works as follows: the gate stands in front of a "home," which is * really a class, and only lets specific friends in. * * To implement a call gate that gives client C access to host H, * - derive a gate class from callgate; * - make the gate class a friend of H; * - make C a friend of the gate class; and * - implement "stuff C can do with H" as private members in the gate class. * * This special kind of "gated" friendship gives C private access to H, but only * through an expressly limited interface. The gate class can access its host * object as home(). * * Keep gate classes entirely stateless. They should be ultra-lightweight * wrappers for their host classes, and be optimized away as much as possible by * the compiler. Once you start adding state, you're on a slippery slope away * from the pure, clean, limited interface pattern that gate classes are meant * to implement. * * Ideally, all member functions of the gate class should be one-liners passing * calls straight on to the host class. It can be useful however to break this * rule temporarily during inter-class refactoring. */ template class PQXX_PRIVATE callgate { protected: /// This class, to keep constructors easy. using super = callgate; /// A reference to the host class. Helps keep constructors easy. using reference = HOME &; callgate(reference x) : m_home(x) {} /// The home object. The gate class has full "private" access. reference home() const noexcept { return m_home; } private: reference m_home; }; } // namespace pqxx::internal } // namespace pqxx #endif libpqxx-6.4.5/include/pqxx/internal/encoding_group.hxx000066400000000000000000000015251350065432700232170ustar00rootroot00000000000000/** Enum type for supporting encodings in libpqxx * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_ENCODING_GROUP #define PQXX_H_ENCODING_GROUP namespace pqxx { namespace internal { // Types of encodings supported by PostgreSQL, see // https://www.postgresql.org/docs/current/static/multibyte.html#CHARSET-TABLE enum class encoding_group { // Handles all single-byte fixed-width encodings MONOBYTE, // Multibyte encodings BIG5, EUC_CN, EUC_JP, EUC_JIS_2004, EUC_KR, EUC_TW, GB18030, GBK, JOHAB, MULE_INTERNAL, SJIS, SHIFT_JIS_2004, UHC, UTF8 }; } // namespace pqxx::internal } // namespace pqxx #endif libpqxx-6.4.5/include/pqxx/internal/encodings.hxx000066400000000000000000000053571350065432700221750ustar00rootroot00000000000000/** Internal string encodings support for libpqxx * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_ENCODINGS #define PQXX_H_ENCODINGS #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/internal/encoding_group.hxx" #include namespace pqxx { namespace internal { const char *name_encoding(int encoding_id); /// Convert libpq encoding enum or encoding name to its libpqxx group. encoding_group enc_group(int /* libpq encoding ID */); encoding_group enc_group(const std::string&); /// Function type: "find the end of the current glyph." /** This type of function takes a text buffer, and a location in that buffer, * and returns the location one byte past the end of the current glyph. * * The start offset marks the beginning of the current glyph. It must fall * within the buffer. * * There are multiple different glyph scnaner implementations, for different * kinds of encodings. */ using glyph_scanner_func = std::string::size_type( const char buffer[], std::string::size_type buffer_len, std::string::size_type start); /// Look up the glyph scanner function for a given encoding group. /** To identify the glyph boundaries in a buffer, call this to obtain the * scanner function appropriate for the buffer's encoding. Then, repeatedly * call the scanner function to find the glyphs. */ PQXX_LIBEXPORT glyph_scanner_func *get_glyph_scanner(encoding_group); /// Find a single-byte "needle" character in a "haystack" text buffer. std::string::size_type find_with_encoding( encoding_group enc, const std::string& haystack, char needle, std::string::size_type start = 0 ); PQXX_LIBEXPORT std::string::size_type find_with_encoding( encoding_group enc, const std::string& haystack, const std::string& needle, std::string::size_type start = 0 ); /// Iterate over the glyphs in a buffer. /** Scans the glyphs in the buffer, and for each, passes its begin and its * one-past-end pointers to @c callback. */ template PQXX_LIBEXPORT inline void for_glyphs( encoding_group enc, CALLABLE callback, const char buffer[], std::string::size_type buffer_len, std::string::size_type start = 0 ) { const auto scan = get_glyph_scanner(enc); for ( std::string::size_type here = start, next; here < buffer_len; here = next ) { next = scan(buffer, buffer_len, here); callback(buffer + here, buffer + next); } } } // namespace pqxx::internal } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/internal/gates/000077500000000000000000000000001350065432700205645ustar00rootroot00000000000000libpqxx-6.4.5/include/pqxx/internal/gates/connection-dbtransaction.hxx000066400000000000000000000007361350065432700263130ustar00rootroot00000000000000#include namespace pqxx { class dbtransaction; namespace internal { namespace gate { class PQXX_PRIVATE connection_dbtransaction : callgate { friend class pqxx::dbtransaction; connection_dbtransaction(reference x) : super(x) {} int get_reactivation_avoidance_count() const noexcept { return home().m_reactivation_avoidance.get(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-errorhandler.hxx000066400000000000000000000011001350065432700261310ustar00rootroot00000000000000#include namespace pqxx { class connection_base; class errorhandler; namespace internal { namespace gate { class PQXX_PRIVATE connection_errorhandler : callgate { friend class pqxx::errorhandler; connection_errorhandler(reference x) : super(x) {} void register_errorhandler(errorhandler *h) { home().register_errorhandler(h); } void unregister_errorhandler(errorhandler *h) { home().unregister_errorhandler(h); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-largeobject.hxx000066400000000000000000000013531350065432700257350ustar00rootroot00000000000000#include #include #include namespace pqxx { class largeobject; namespace internal { namespace gate { class PQXX_PRIVATE connection_largeobject : callgate { friend class pqxx::largeobject; connection_largeobject(reference x) : super(x) {} pq::PGconn *raw_connection() const { return home().raw_connection(); } }; class PQXX_PRIVATE const_connection_largeobject : callgate { friend class pqxx::largeobject; const_connection_largeobject(reference x) : super(x) {} std::string error_message() const { return home().err_msg(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-notification_receiver.hxx000066400000000000000000000011661350065432700300300ustar00rootroot00000000000000#include #include namespace pqxx { class notification_receiver; namespace internal { namespace gate { class PQXX_PRIVATE connection_notification_receiver : callgate { friend class pqxx::notification_receiver; connection_notification_receiver(reference x) : super(x) {} void add_receiver(notification_receiver *receiver) { home().add_receiver(receiver); } void remove_receiver(notification_receiver *receiver) noexcept { home().remove_receiver(receiver); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-parameterized_invocation.hxx000066400000000000000000000014021350065432700305340ustar00rootroot00000000000000#include namespace pqxx { class connection_base; namespace internal { namespace gate { class PQXX_PRIVATE connection_parameterized_invocation : callgate { friend class pqxx::internal::parameterized_invocation; connection_parameterized_invocation(reference x) : super(x) {} result parameterized_exec( const std::string &query, const char *const params[], const int paramlengths[], const int binaries[], int nparams) { #include return home().parameterized_exec( query, params, paramlengths, binaries, nparams); #include } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-pipeline.hxx000066400000000000000000000013701350065432700252600ustar00rootroot00000000000000#include #include "pqxx/internal/libpq-forward.hxx" namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE connection_pipeline : callgate { friend class pqxx::pipeline; connection_pipeline(reference x) : super(x) {} void start_exec(const std::string &query) { home().start_exec(query); } pqxx::internal::pq::PGresult *get_result() { return home().get_result(); } void cancel_query() { home().cancel_query(); } bool consume_input() noexcept { return home().consume_input(); } bool is_busy() const noexcept { return home().is_busy(); } int encoding_id() { return home().encoding_id(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-prepare-invocation.hxx000066400000000000000000000016511350065432700272620ustar00rootroot00000000000000#include namespace pqxx { namespace prepare { class invocation; } // namespace pqxx::prepare namespace internal { namespace gate { class PQXX_PRIVATE connection_prepare_invocation : callgate { friend class pqxx::prepare::invocation; connection_prepare_invocation(reference x) : super(x) {} /// @deprecated To be replaced by exec_prepared. result prepared_exec( const std::string &statement, const char *const params[], const int paramlengths[], const int binary[], int nparams) { #include return home().prepared_exec( statement, params, paramlengths, binary, nparams); #include } bool prepared_exists(const std::string &statement) const { return home().prepared_exists(statement); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-reactivation_avoidance_exemption.hxx000066400000000000000000000012471350065432700322470ustar00rootroot00000000000000#include namespace pqxx { namespace internal { class reactivation_avoidance_exemption; namespace gate { class PQXX_PRIVATE connection_reactivation_avoidance_exemption : callgate { friend class pqxx::internal::reactivation_avoidance_exemption; connection_reactivation_avoidance_exemption(reference x) : super(x) {} int get_counter() const { return home().m_reactivation_avoidance.get(); } void add_counter(int x) const { home().m_reactivation_avoidance.add(x); } void clear_counter() { home().m_reactivation_avoidance.clear(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-sql_cursor.hxx000066400000000000000000000010521350065432700256440ustar00rootroot00000000000000#include namespace pqxx { namespace internal { class sql_cursor; namespace gate { class PQXX_PRIVATE connection_sql_cursor : callgate { friend class pqxx::internal::sql_cursor; connection_sql_cursor(reference x) : super(x) {} result exec(const char query[], int retries) { return home().exec(query, retries); } void add_reactivation_avoidance_count(int n) { home().add_reactivation_avoidance_count(n); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/connection-transaction.hxx000066400000000000000000000037741350065432700260120ustar00rootroot00000000000000#include namespace pqxx { class connection_base; namespace internal { namespace gate { class PQXX_PRIVATE connection_transaction : callgate { friend class pqxx::transaction_base; connection_transaction(reference x) : super(x) {} result exec(const char query[], int retries) { return home().exec(query, retries); } void register_transaction(transaction_base *t) { home().register_transaction(t); } void unregister_transaction(transaction_base *t) noexcept { home().unregister_transaction(t); } bool read_copy_line(std::string &line) { return home().read_copy_line(line); } void write_copy_line(const std::string &line) { home().write_copy_line(line); } void end_copy_write() { home().end_copy_write(); } std::string raw_get_var(const std::string &var) { return home().raw_get_var(var); } void raw_set_var(const std::string &var, const std::string &value) { home().raw_set_var(var, value); } void add_variables(const std::map &vars) { home().add_variables(vars); } /// @deprecated To be replaced by exec_prepared. result prepared_exec( const std::string &statement, const char *const params[], const int paramlengths[], const int binaries[], int nparams) { #include return home().prepared_exec( statement, params, paramlengths, binaries, nparams); #include } result exec_prepared( const std::string &statement, const internal::params &args) { return home().exec_prepared(statement, args); } result exec_params(const std::string &query, const internal::params &args) { return home().exec_params(query, args); } bool prepared_exists(const std::string &statement) const { return home().prepared_exists(statement); } void take_reactivation_avoidance(int counter) { home().m_reactivation_avoidance.add(counter); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/errorhandler-connection.hxx000066400000000000000000000006321350065432700261420ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE errorhandler_connection_base : callgate { friend class pqxx::connection_base; errorhandler_connection_base(reference x) : super(x) {} void unregister() noexcept { home().unregister(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/icursor_iterator-icursorstream.hxx000066400000000000000000000013331350065432700276140ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE icursor_iterator_icursorstream : callgate { friend class pqxx::icursorstream; icursor_iterator_icursorstream(reference x) : super(x) {} icursor_iterator::difference_type pos() const noexcept { return home().pos(); } icursor_iterator *get_prev() { return home().m_prev; } void set_prev(icursor_iterator *i) { home().m_prev = i; } icursor_iterator *get_next() { return home().m_next; } void set_next(icursor_iterator *i) { home().m_next = i; } void fill(const result &r) { home().fill(r); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/icursorstream-icursor_iterator.hxx000066400000000000000000000014321350065432700276140ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE icursorstream_icursor_iterator : callgate { friend class pqxx::icursor_iterator; icursorstream_icursor_iterator(reference x) : super(x) {} void insert_iterator(icursor_iterator *i) noexcept { home().insert_iterator(i); } void remove_iterator(icursor_iterator *i) const noexcept { home().remove_iterator(i); } icursorstream::size_type forward() { return home().forward(); } icursorstream::size_type forward(icursorstream::size_type n) { return home().forward(n); } void service_iterators(icursorstream::difference_type p) { home().service_iterators(p); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/result-connection.hxx000066400000000000000000000006571350065432700250000ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE result_connection : callgate { friend class pqxx::connection_base; result_connection(reference x) : super(x) {} operator bool() const { return bool(home()); } bool operator!() const { return not home(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/result-creation.hxx000066400000000000000000000011171350065432700244350ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE result_creation : callgate { friend class pqxx::connection_base; friend class pqxx::pipeline; result_creation(reference x) : super(x) {} static result create( internal::pq::PGresult *rhs, const std::string &query, encoding_group enc) { return result(rhs, query, enc); } void check_status() const { return home().check_status(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/result-row.hxx000066400000000000000000000005461350065432700234450ustar00rootroot00000000000000#include namespace pqxx { namespace internal { class row; namespace gate { class PQXX_PRIVATE result_row : callgate { friend class pqxx::row; result_row(reference x) : super(x) {} operator bool() { return bool(home()); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/result-sql_cursor.hxx000066400000000000000000000006351350065432700250310ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE result_sql_cursor : callgate { friend class pqxx::internal::sql_cursor; result_sql_cursor(reference x) : super(x) {} const char *cmd_status() const noexcept { return home().cmd_status(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/transaction-sql_cursor.hxx000066400000000000000000000005371350065432700260410ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE transaction_sql_cursor : callgate { friend class pqxx::internal::sql_cursor; transaction_sql_cursor(reference x) : super(x) {} }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/transaction-stream_from.hxx000066400000000000000000000010431350065432700261540ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE transaction_stream_from : callgate { friend class pqxx::stream_from; transaction_stream_from(reference x) : super(x) {} void BeginCopyRead(const std::string &table, const std::string &columns) { home().BeginCopyRead(table, columns); } bool read_copy_line(std::string &line) { return home().read_copy_line(line); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/transaction-stream_to.hxx000066400000000000000000000011511350065432700256330ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE transaction_stream_to : callgate { friend class pqxx::stream_to; transaction_stream_to(reference x) : super(x) {} void BeginCopyWrite( const std::string &table, const std::string &columns = std::string{}) { home().BeginCopyWrite(table, columns); } void write_copy_line(const std::string &line) { home().write_copy_line(line); } void end_copy_write() { home().end_copy_write(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/transaction-subtransaction.hxx000066400000000000000000000006771350065432700267110ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE transaction_subtransaction : callgate { friend class pqxx::subtransaction; transaction_subtransaction(reference x) : super(x) {} void add_reactivation_avoidance_count(int n) { home().m_reactivation_avoidance.add(n); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/transaction-tablereader.hxx000066400000000000000000000010431350065432700261100ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE transaction_tablereader : callgate { friend class pqxx::tablereader; transaction_tablereader(reference x) : super(x) {} void BeginCopyRead(const std::string &table, const std::string &columns) { home().BeginCopyRead(table, columns); } bool read_copy_line(std::string &line) { return home().read_copy_line(line); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/transaction-tablewriter.hxx000066400000000000000000000011571350065432700261700ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE transaction_tablewriter : callgate { friend class pqxx::tablewriter; transaction_tablewriter(reference x) : super(x) {} void BeginCopyWrite( const std::string &table, const std::string &columns = std::string{}) { home().BeginCopyWrite(table, columns); } void write_copy_line(const std::string &line) { home().write_copy_line(line); } void end_copy_write() { home().end_copy_write(); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/gates/transaction-transactionfocus.hxx000066400000000000000000000012061350065432700272240ustar00rootroot00000000000000#include namespace pqxx { namespace internal { namespace gate { class PQXX_PRIVATE transaction_transactionfocus : callgate { friend class pqxx::internal::transactionfocus; transaction_transactionfocus(reference x) : super(x) {} void register_focus(transactionfocus *focus) { home().register_focus(focus); } void unregister_focus(transactionfocus *focus) noexcept { home().unregister_focus(focus); } void register_pending_error(const std::string &error) { home().register_pending_error(error); } }; } // namespace pqxx::internal::gate } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/include/pqxx/internal/ignore-deprecated-post.hxx000066400000000000000000000002031350065432700245510ustar00rootroot00000000000000/// End a code block started by "ignore-deprecated-pre.hxx". #if defined(__GNUC__) #pragma GCC diagnostic pop #endif // __GNUC__ libpqxx-6.4.5/include/pqxx/internal/ignore-deprecated-pre.hxx000066400000000000000000000012721350065432700243610ustar00rootroot00000000000000/** Start a block of deprecated code which may call other deprecated code. * * Most compilers will emit warnings when deprecated code is invoked from * non-deprecated code. But some compilers (notably gcc) will always emit the * warning, even when the calling code is also deprecated. * * This header starts a block where those warnings are suppressed. It can be * included inside a code block. * * Always match the #include with a closing #include of * "ignore-deprecated-post.hxx". To avoid mistakes, keep the enclosed area as * small as possible. */ #if defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif // __GNUC__ libpqxx-6.4.5/include/pqxx/internal/libpq-forward.hxx000066400000000000000000000014271350065432700227670ustar00rootroot00000000000000/** Minimal forward declarations of libpq types needed in libpqxx headers. * * DO NOT INCLUDE THIS FILE when building client programs. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ extern "C" { struct pg_conn; struct pg_result; struct pgNotify; } namespace pqxx { namespace internal { /// Forward declarations of libpq types as needed in libpqxx headers namespace pq { using PGconn = pg_conn; using PGresult = pg_result; using PGnotify = pgNotify; using PQnoticeProcessor = void (*)(void *, const char *); } } /// PostgreSQL database row identifier using oid = unsigned int; } // extern "C" libpqxx-6.4.5/include/pqxx/internal/sql_cursor.hxx000066400000000000000000000074251350065432700224160ustar00rootroot00000000000000/** Internal wrapper for SQL cursors. Supports higher-level cursor classes. * * DO NOT INCLUDE THIS FILE DIRECTLY. Other headers include it for you. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this * mistake, or contact the author. */ #ifndef PQXX_H_SQL_CURSOR #define PQXX_H_SQL_CURSOR namespace pqxx { namespace internal { /// Cursor with SQL positioning semantics. /** Thin wrapper around an SQL cursor, with SQL's ideas of positioning. * * SQL cursors have pre-increment/pre-decrement semantics, with on either end of * the result set a special position that does not repesent a row. This class * models SQL cursors for the purpose of implementing more C++-like semantics on * top. * * Positions of actual rows are numbered starting at 1. Position 0 exists but * does not refer to a row. There is a similar non-row position at the end of * the result set. * * Don't use this at home. You deserve better. Use the stateles_cursor * instead. */ class PQXX_LIBEXPORT sql_cursor : public cursor_base { public: sql_cursor( transaction_base &t, const std::string &query, const std::string &cname, cursor_base::accesspolicy ap, cursor_base::updatepolicy up, cursor_base::ownershippolicy op, bool hold); sql_cursor( transaction_base &t, const std::string &cname, cursor_base::ownershippolicy op); ~sql_cursor() noexcept { close(); } result fetch(difference_type rows, difference_type &displacement); result fetch(difference_type rows) { difference_type d=0; return fetch(rows, d); } difference_type move(difference_type rows, difference_type &displacement); difference_type move(difference_type rows) { difference_type d=0; return move(rows, d); } /// Current position, or -1 for unknown /** * The starting position, just before the first row, counts as position zero. * * Position may be unknown if (and only if) this cursor was adopted, and has * never hit its starting position (position zero). */ difference_type pos() const noexcept { return m_pos; } /// End position, or -1 for unknown /** * Returns the final position, just after the last row in the result set. The * starting position, just before the first row, counts as position zero. * * End position is unknown until it is encountered during use. */ difference_type endpos() const noexcept { return m_endpos; } /// Return zero-row result for this cursor const result &empty_result() const noexcept { return m_empty_result; } void close() noexcept; private: difference_type adjust(difference_type hoped, difference_type actual); static std::string stridestring(difference_type); /// Initialize cached empty result. Call only at beginning or end! void init_empty_result(transaction_base &); /// Connection this cursor lives in connection_base &m_home; /// Zero-row result from this cursor (or plain empty one if cursor is adopted) result m_empty_result; result m_cached_current_row; /// Is this cursor adopted (as opposed to created by this cursor object)? bool m_adopted; /// Will this cursor object destroy its SQL cursor when it dies? cursor_base::ownershippolicy m_ownership; /// At starting position (-1), somewhere in the middle (0), or past end (1) int m_at_end; /// Position, or -1 for unknown difference_type m_pos; /// End position, or -1 for unknown difference_type m_endpos = -1; }; PQXX_LIBEXPORT result_size_type obtain_stateless_cursor_size(sql_cursor &); PQXX_LIBEXPORT result stateless_cursor_retrieve( sql_cursor &, result::difference_type size, result::difference_type begin_pos, result::difference_type end_pos); } // namespace internal } // namespace pqxx #endif libpqxx-6.4.5/include/pqxx/internal/statement_parameters.hxx000066400000000000000000000150641350065432700244470ustar00rootroot00000000000000/** Common implementation for statement parameter lists. * * These are used for both prepared statements and parameterized statements. * * DO NOT INCLUDE THIS FILE DIRECTLY. Other headers include it for you. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_STATEMENT_PARAMETER #define PQXX_H_STATEMENT_PARAMETER #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include #include #include #include "pqxx/binarystring" #include "pqxx/strconv" #include "pqxx/util" #include "pqxx/internal/type_utils.hxx" namespace pqxx { namespace internal { /// Marker type: pass a dynamically-determined number of statement parameters. /** Normally when invoking a prepared or parameterised statement, the number * of parameters is known at compile time. For instance, * @c t.exec_prepared("foo", 1, "x"); executes statement @c foo with two * parameters, an @c int and a C string. * * But sometimes you may want to pass a number of parameters known only at run * time. In those cases, a @c dynamic_params encodes a dynamically * determined number of parameters. */ template class dynamic_params { public: /// Wrap a sequence of pointers or iterators. dynamic_params(IT begin, IT end) : m_begin(begin), m_end(end) {} /// Wrap a container. template explicit dynamic_params(const C &container) : m_begin(std::begin(container)), m_end(std::end(container)) {} IT begin() const { return m_begin; } IT end() const { return m_end; } private: const IT m_begin, m_end; }; class PQXX_LIBEXPORT statement_parameters { protected: statement_parameters() =default; statement_parameters &operator=(const statement_parameters &) =delete; void add_param() { this->add_checked_param("", false, false); } template void add_param(const T &v, bool nonnull) { nonnull = (nonnull && not pqxx::string_traits::is_null(v)); this->add_checked_param( (nonnull ? pqxx::to_string(v) : ""), nonnull, false); } void add_binary_param(const binarystring &b, bool nonnull) { this->add_checked_param(b.str(), nonnull, true); } /// Marshall parameter values into C-compatible arrays for passing to libpq. int marshall( std::vector &values, std::vector &lengths, std::vector &binaries) const; private: void add_checked_param(const std::string &value, bool nonnull, bool binary); std::vector m_values; std::vector m_nonnull; std::vector m_binary; }; /// Internal type: encode statement parameters. /** Compiles arguments for prepared statements and parameterised queries into * a format that can be passed into libpq. * * Objects of this type are meant to be short-lived. If you pass in a non-null * pointer as a parameter, it may simply use that pointer as a parameter value. */ struct params { /// Construct directly from a series of statement arguments. /** The arrays all default to zero, null, and empty strings. */ template params(Args && ... args) { strings.reserve(sizeof...(args)); lengths.reserve(sizeof...(args)); nonnulls.reserve(sizeof...(args)); binaries.reserve(sizeof...(args)); // Start recursively storing parameters. add_fields(std::forward(args)...); } /// Compose a vector of pointers to parameter string values. std::vector get_pointers() const { const std::size_t num_fields = lengths.size(); std::size_t cur_string = 0, cur_bin_string = 0; std::vector pointers(num_fields); for (std::size_t index = 0; index < num_fields; index++) { const char *value; if (binaries[index]) { value = bin_strings[cur_bin_string].get(); cur_bin_string++; } else if (nonnulls[index]) { value = strings[cur_string].c_str(); cur_string++; } else { value = nullptr; } pointers[index] = value; } return pointers; } /// String values, for string parameters. std::vector strings; /// As used by libpq: lengths of non-null arguments, in bytes. std::vector lengths; /// As used by libpq: boolean "is this parameter non-null?" std::vector nonnulls; /// As used by libpq: boolean "is this parameter in binary format?" std::vector binaries; /// Binary string values, for binary parameters. std::vector bin_strings; private: /// Add a non-null string field. void add_field(std::string str) { lengths.push_back(int(str.size())); nonnulls.push_back(1); binaries.push_back(0); strings.emplace_back(std::move(str)); } /// Compile one argument (specialised for null pointer, a null value). void add_field(std::nullptr_t) { lengths.push_back(0); nonnulls.push_back(0); binaries.push_back(0); } /// Compile one argument (specialised for binarystring). void add_field(const binarystring &arg) { lengths.push_back(int(arg.size())); nonnulls.push_back(1); binaries.push_back(1); bin_strings.push_back(arg); } /// Compile one argument (default, generic implementation). /** Uses string_traits to represent the argument as a std::string. */ template void add_field(const Arg &arg) { if (string_traits::is_null(arg)) add_field(nullptr); else add_field(to_string(arg)); } /// Compile a dynamic_params object into a dynamic number of parameters. template void add_field(const dynamic_params ¶meters) { for (auto param: parameters) add_field(param); } /// Compile argument list. /** This recursively "peels off" the next remaining element, compiles its * information into its final form, and calls itself for the rest of the * list. * * @param arg Current argument to be compiled. * @param args Optional remaining arguments, to be compiled recursively. */ template void add_fields(Arg &&arg, More && ... args) { add_field(std::forward(arg)); // Compile remaining arguments, if any. add_fields(std::forward(args)...); } /// Terminating version of add_fields, at the end of the list. /** Recursion in add_fields ends with this call. */ void add_fields() {} }; } // namespace pqxx::internal } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/internal/type_utils.hxx000066400000000000000000000157621350065432700224260ustar00rootroot00000000000000/** Type/template metaprogramming utilities for use internally in libpqxx * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_TYPE_UTILS #define PQXX_H_TYPE_UTILS #include #include #if defined(PQXX_HAVE_OPTIONAL) #include #elif defined(PQXX_HAVE_EXP_OPTIONAL) && !defined(PQXX_HIDE_EXP_OPTIONAL) #include #endif namespace pqxx { namespace internal { /// Replicate std::void_t<> (available in C++17). template using void_t = void; /// Extract the content type held by an `optional`-like wrapper type. /* Replace nested `std::remove_*`s with `std::remove_cvref` in C++20 */ template using inner_type = typename std::remove_cv< typename std::remove_reference< decltype(*std::declval()) >::type >::type; /// Does the given type have an `operator *()`? template struct is_derefable : std::false_type {}; template struct is_derefable::value, T>::type> >> : std::true_type {}; /// Should the given type be treated as an optional-value wrapper type? template struct is_optional : std::false_type {}; template struct is_optional::value // Check if an `explicit operator bool` exists for this type && std::is_constructible::value )>::type> : std::true_type {}; /// Can `nullopt_t` implicitly convert to type T? template< typename T, typename = void > struct takes_std_nullopt : std::false_type {}; #if defined(PQXX_HAVE_OPTIONAL) template struct takes_std_nullopt< T, typename std::enable_if::value>::type > : std::true_type {}; #elif defined(PQXX_HAVE_EXP_OPTIONAL) && !defined(PQXX_HIDE_EXP_OPTIONAL) template struct takes_std_nullopt< T, typename std::enable_if< std::is_assignable::value >::type > : std::true_type {}; #endif /// Is type T a `std::tuple<>`? template struct is_tuple : std::false_type {}; template struct is_tuple< T, typename std::enable_if<(std::tuple_size::value >= 0)>::type > : std::true_type {}; /// Is type T an iterable container? template struct is_container : std::false_type {}; template struct is_container< T, void_t< decltype(std::begin(std::declval())), decltype(std::end(std::declval())), // Some people might implement a `std::tuple<>` specialization that is // iterable when all the contained types are the same ;) typename std::enable_if::value>::type > > : std::true_type {}; /// Get an appropriate null value for the given type. /** * pointer types `nullptr` * `std::optional<>`-like `std::nullopt` * `std::experimental::optional<>`-like `std::experimental::nullopt` * other types `pqxx::string_traits<>::null()` * Users may add support for their own wrapper types following this pattern. */ template constexpr auto null_value() -> typename std::enable_if< ( is_optional::value && not takes_std_nullopt::value && std::is_assignable::value ), std::nullptr_t >::type { return nullptr; } template constexpr auto null_value() -> typename std::enable_if< (not is_optional::value && not takes_std_nullopt::value), decltype(pqxx::string_traits::null()) >::type { return pqxx::string_traits::null(); } #if defined(PQXX_HAVE_OPTIONAL) template constexpr auto null_value() -> typename std::enable_if< takes_std_nullopt::value, std::nullopt_t >::type { return std::nullopt; } #elif defined(PQXX_HAVE_EXP_OPTIONAL) && !defined(PQXX_HIDE_EXP_OPTIONAL) template constexpr auto null_value() -> typename std::enable_if< takes_std_nullopt::value, std::experimental::nullopt_t >::type { return std::experimental::nullopt; } #endif /// Construct an optional-like type from the stored type. /** * While these may seem redundant, they are necessary to support smart pointers * as optional storage types in a generic manner. It is suggested NOT to * provide a version for `inner_type*` as that will almost certainly leak * memory. * Users may add support for their own wrapper types following this pattern. */ // Enabled if the wrapper type can be directly constructed from the wrapped type // (e.g. `std::optional<>`); explicitly disabled for raw pointers in case the // inner type is convertible to a pointer (e.g. `int`) template constexpr auto make_optional(V&& v) -> typename std::enable_if< not std::is_same*>::value, decltype(T(std::forward(v))) >::type { return T(std::forward(v)); } // Enabled if T is a specialization of `std::unique_ptr<>`. template constexpr auto make_optional(V&& v) -> typename std::enable_if< std::is_same>>::value, std::unique_ptr> >::type { return std::unique_ptr>(new inner_type(std::forward(v))); } // Enabled if T is a specialization of `std::shared_ptr<>`. template constexpr auto make_optional(V&& v) -> typename std::enable_if< std::is_same>>::value, std::shared_ptr> >::type { return std::make_shared>(std::forward(v)); } } // namespace pqxx::internal } // namespace pqxx // TODO: Move? namespace pqxx { /// Meta `pqxx::string_traits` for std::optional-like types. template struct string_traits< T, typename std::enable_if::value>::type > { private: using I = internal::inner_type; public: static constexpr const char *name() noexcept { return string_traits::name(); } static constexpr bool has_null() noexcept { return true; } static bool is_null(const T& v) { return (not v || string_traits::is_null(*v)); } static constexpr T null() { return internal::null_value(); } static void from_string(const char Str[], T &Obj) { if (not Str) Obj = null(); else { I inner; string_traits::from_string(Str, inner); // Utilize existing memory if possible (e.g. for pointer types). if (Obj) *Obj = inner; // Important to assign to set valid flag for smart optional types. else Obj = internal::make_optional(inner); } } static std::string to_string(const T& Obj) { if (is_null(Obj)) internal::throw_null_conversion(name()); return string_traits::to_string(*Obj); } }; } // namespace pqxx #endif libpqxx-6.4.5/include/pqxx/isolation000066400000000000000000000003261350065432700175720ustar00rootroot00000000000000/** Transaction isolation levels. * * Policies and traits describing SQL transaction isolation levels */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/isolation.hxx" libpqxx-6.4.5/include/pqxx/isolation.hxx000066400000000000000000000060621350065432700204030ustar00rootroot00000000000000/** Definitions of transaction isolation levels. * * Policies and traits describing SQL transaction isolation levels * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/isolation instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_ISOLATION #define PQXX_H_ISOLATION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/util.hxx" namespace pqxx { /// Transaction isolation levels. /** These are as defined in the SQL standard. But there are a few notes * specific to PostgreSQL. * * First, postgres does not support "read uncommitted." The lowest level you * can get is "read committed," which is better. PostgreSQL is built on the * MVCC paradigm, which guarantees "read committed" isolation without any * additional performance overhead, so there was no point in providing the * lower level. * * Second, "repeatable read" also makes more isolation guarantees than the * standard requires. According to the standard, this level prevents "dirty * reads" and "nonrepeatable reads," but not "phantom reads." In postgres, * it actually prevents all three. * * Third, "serializable" is only properly supported starting at postgres 9.1. * If you request "serializable" isolation on an older backend, you will get * the same isolation as in "repeatable read." It's better than the "repeatable * read" defined in the SQL standard, but not a complete implementation of the * standard's "serializable" isolation level. * * In general, a lower isolation level will allow more surprising interactions * between ongoing transactions, but improve performance. A higher level * gives you more protection from subtle concurrency bugs, but sometimes it * may not be possible to complete your transaction without avoiding paradoxes * in the data. In that case a transaction may fail, and the application will * have to re-do the whole thing based on the latest state of the database. * (If you want to retry your code in that situation, have a look at the * transactor framework.) * * Study the levels and design your application with the right level in mind. */ enum isolation_level { // read_uncommitted, read_committed, repeatable_read, serializable }; /// Traits class to describe an isolation level; primarly for libpqxx's own use template struct isolation_traits { static constexpr isolation_level level() noexcept { return LEVEL; } static constexpr const char *name() noexcept; }; template<> inline constexpr const char *isolation_traits::name() noexcept { return "READ COMMITTED"; } template<> inline constexpr const char *isolation_traits::name() noexcept { return "REPEATABLE READ"; } template<> inline constexpr const char *isolation_traits::name() noexcept { return "SERIALIZABLE"; } } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/largeobject000066400000000000000000000003331350065432700200500ustar00rootroot00000000000000/** Large Objects interface. * * Supports direct access to large objects, as well as through I/O streams */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/largeobject.hxx" libpqxx-6.4.5/include/pqxx/largeobject.hxx000066400000000000000000000524601350065432700206660ustar00rootroot00000000000000/** Large Objects interface. * * Allows access to large objects directly, or through I/O streams. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/largeobject instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_LARGEOBJECT #define PQXX_H_LARGEOBJECT #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include "pqxx/dbtransaction.hxx" namespace pqxx { /// Identity of a large object /** This class encapsulates the identity of a large object. To access the * contents of the object, create a largeobjectaccess, a largeobject_streambuf, * or an ilostream, an olostream or a lostream around the largeobject. * * A largeobject must be accessed only from within a backend transaction, but * the object's identity remains valid as long as the object exists. */ class PQXX_LIBEXPORT largeobject { public: using size_type = large_object_size_type; /// Refer to a nonexistent large object (similar to what a null pointer does) largeobject() noexcept =default; //[t48] /// Create new large object /** @param T Backend transaction in which the object is to be created */ explicit largeobject(dbtransaction &T); //[t48] /// Wrap object with given oid /** Convert combination of a transaction and object identifier into a * large object identity. Does not affect the database. * @param O Object identifier for the given object */ explicit largeobject(oid O) noexcept : m_id{O} {} //[t48] /// Import large object from a local file /** Creates a large object containing the data found in the given file. * @param T Backend transaction in which the large object is to be created * @param File A filename on the client program's filesystem */ largeobject(dbtransaction &T, const std::string &File); //[t53] /// Take identity of an opened large object /** Copy identity of already opened large object. Note that this may be done * as an implicit conversion. * @param O Already opened large object to copy identity from */ largeobject(const largeobjectaccess &O) noexcept; //[t50] /// Object identifier /** The number returned by this function identifies the large object in the * database we're connected to (or oid_none is returned if we refer to the * null object). */ oid id() const noexcept { return m_id; } //[t48] /** * @name Identity comparisons * * These operators compare the object identifiers of large objects. This has * nothing to do with the objects' actual contents; use them only for keeping * track of containers of references to large objects and such. */ //@{ /// Compare object identities /** @warning Only valid between large objects in the same database. */ bool operator==(const largeobject &other) const //[t51] { return m_id == other.m_id; } /// Compare object identities /** @warning Only valid between large objects in the same database. */ bool operator!=(const largeobject &other) const //[t51] { return m_id != other.m_id; } /// Compare object identities /** @warning Only valid between large objects in the same database. */ bool operator<=(const largeobject &other) const //[t51] { return m_id <= other.m_id; } /// Compare object identities /** @warning Only valid between large objects in the same database. */ bool operator>=(const largeobject &other) const //[t51] { return m_id >= other.m_id; } /// Compare object identities /** @warning Only valid between large objects in the same database. */ bool operator<(const largeobject &other) const //[t51] { return m_id < other.m_id; } /// Compare object identities /** @warning Only valid between large objects in the same database. */ bool operator>(const largeobject &other) const //[t51] { return m_id > other.m_id; } //@} /// Export large object's contents to a local file /** Writes the data stored in the large object to the given file. * @param T Transaction in which the object is to be accessed * @param File A filename on the client's filesystem */ void to_file(dbtransaction &T, const std::string &File) const; //[t52] /// Delete large object from database /** Unlike its low-level equivalent cunlink, this will throw an exception if * deletion fails. * @param T Transaction in which the object is to be deleted */ void remove(dbtransaction &T) const; //[t48] protected: PQXX_PURE static internal::pq::PGconn *raw_connection( const dbtransaction &T); PQXX_PRIVATE std::string reason(const connection_base &, int err) const; private: oid m_id = oid_none; }; // TODO: New hierarchy with separate read / write / mixed-mode access /// Accessor for large object's contents. class PQXX_LIBEXPORT largeobjectaccess : private largeobject { public: using largeobject::size_type; using off_type = long; using pos_type = size_type; /// Open mode: @c in, @c out (can be combined with the "or" operator) /** According to the C++ standard, these should be in @c std::ios_base. We * take them from @c std::ios instead, which should be safe because it * inherits the same definition, to accommodate gcc 2.95 & 2.96. */ using openmode = std::ios::openmode; /// Seek direction: @c beg, @c cur, @c end /** According to the C++ standard, these should be in @c std::ios_base. We * take them from @c std::ios instead, which should be safe because it * inherits the same definition, to accommodate gcc 2.95 & 2.96. */ using seekdir = std::ios::seekdir; /// Create new large object and open it /** * @param T Backend transaction in which the object is to be created * @param mode Access mode, defaults to ios_base::in | ios_base::out */ explicit largeobjectaccess( //[t51] dbtransaction &T, openmode mode=std::ios::in|std::ios::out); /// Open large object with given oid /** Convert combination of a transaction and object identifier into a * large object identity. Does not affect the database. * @param T Transaction in which the object is to be accessed * @param O Object identifier for the given object * @param mode Access mode, defaults to ios_base::in | ios_base::out */ largeobjectaccess( //[t52] dbtransaction &T, oid O, openmode mode=std::ios::in|std::ios::out); /// Open given large object /** Open a large object with the given identity for reading and/or writing * @param T Transaction in which the object is to be accessed * @param O Identity for the large object to be accessed * @param mode Access mode, defaults to ios_base::in | ios_base::out */ largeobjectaccess( //[t50] dbtransaction &T, largeobject O, openmode mode=std::ios::in|std::ios::out); /// Import large object from a local file and open it /** Creates a large object containing the data found in the given file. * @param T Backend transaction in which the large object is to be created * @param File A filename on the client program's filesystem * @param mode Access mode, defaults to ios_base::in | ios_base::out */ largeobjectaccess( //[t55] dbtransaction &T, const std::string &File, openmode mode=std::ios::in|std::ios::out); ~largeobjectaccess() noexcept { close(); } /// Object identifier /** The number returned by this function uniquely identifies the large object * in the context of the database we're connected to. */ using largeobject::id; /// Export large object's contents to a local file /** Writes the data stored in the large object to the given file. * @param File A filename on the client's filesystem */ void to_file(const std::string &File) const //[t54] { largeobject::to_file(m_trans, File); } using largeobject::to_file; /** * @name High-level access to object contents */ //@{ /// Write data to large object /** If not all bytes could be written, an exception is thrown. * @param Buf Data to write * @param Len Number of bytes from Buf to write */ void write(const char Buf[], size_type Len); //[t51] /// Write string to large object /** If not all bytes could be written, an exception is thrown. * @param Buf Data to write; no terminating zero is written */ void write(const std::string &Buf) //[t50] { write(Buf.c_str(), static_cast(Buf.size())); } /// Read data from large object /** Throws an exception if an error occurs while reading. * @param Buf Location to store the read data in * @param Len Number of bytes to try and read * @return Number of bytes read, which may be less than the number requested * if the end of the large object is reached */ size_type read(char Buf[], size_type Len); //[t50] /// Seek in large object's data stream /** Throws an exception if an error occurs. * @return The new position in the large object */ size_type seek(size_type dest, seekdir dir); //[t51] /// Report current position in large object's data stream /** Throws an exception if an error occurs. * @return The current position in the large object */ size_type tell() const; //[t50] //@} /** * @name Low-level access to object contents * * These functions provide a more "C-like" access interface, returning special * values instead of throwing exceptions on error. These functions are * generally best avoided in favour of the high-level access functions, which * behave more like C++ functions should. */ //@{ /// Seek in large object's data stream /** Does not throw exception in case of error; inspect return value and * @c errno instead. * @param dest Offset to go to * @param dir Origin to which dest is relative: ios_base::beg (from beginning * of the object), ios_base::cur (from current access position), or * ios_base;:end (from end of object) * @return New position in large object, or -1 if an error occurred. */ pos_type cseek(off_type dest, seekdir dir) noexcept; //[t50] /// Write to large object's data stream /** Does not throw exception in case of error; inspect return value and * @c errno instead. * @param Buf Data to write * @param Len Number of bytes to write * @return Number of bytes actually written, or -1 if an error occurred. */ off_type cwrite(const char Buf[], size_type Len) noexcept; //[t50] /// Read from large object's data stream /** Does not throw exception in case of error; inspect return value and * @c errno instead. * @param Buf Area where incoming bytes should be stored * @param Len Number of bytes to read * @return Number of bytes actually read, or -1 if an error occurred. */ off_type cread(char Buf[], size_type Len) noexcept; //[t50] /// Report current position in large object's data stream /** Does not throw exception in case of error; inspect return value and * @c errno instead. * @return Current position in large object, of -1 if an error occurred. */ pos_type ctell() const noexcept; //[t50] //@} /** * @name Error/warning output */ //@{ /// Issue message to transaction's notice processor void process_notice(const std::string &) noexcept; //[t50] //@} using largeobject::remove; using largeobject::operator==; using largeobject::operator!=; using largeobject::operator<; using largeobject::operator<=; using largeobject::operator>; using largeobject::operator>=; private: PQXX_PRIVATE std::string reason(int err) const; internal::pq::PGconn *raw_connection() const { return largeobject::raw_connection(m_trans); } PQXX_PRIVATE void open(openmode mode); void close() noexcept; dbtransaction &m_trans; int m_fd = -1; largeobjectaccess() =delete; largeobjectaccess(const largeobjectaccess &) =delete; largeobjectaccess operator=(const largeobjectaccess &) =delete; }; /// Streambuf to use large objects in standard I/O streams /** The standard streambuf classes provide uniform access to data storage such * as files or string buffers, so they can be accessed using standard input or * output streams. This streambuf implementation provides similar access to * large objects, so they can be read and written using the same stream classes. * * @warning This class may not work properly in compiler environments that don't * fully support Standard-compliant streambufs, such as g++ 2.95 or older. */ template> class largeobject_streambuf : public std::basic_streambuf { using size_type = long; public: using char_type = CHAR; using traits_type = TRAITS; using int_type = typename traits_type::int_type; using pos_type = typename traits_type::pos_type; using off_type = typename traits_type::off_type; using openmode = largeobjectaccess::openmode; using seekdir = largeobjectaccess::seekdir; largeobject_streambuf( //[t48] dbtransaction &T, largeobject O, openmode mode=std::ios::in|std::ios::out, size_type BufSize=512) : m_bufsize{BufSize}, m_obj{T, O, mode}, m_g{nullptr}, m_p{nullptr} { initialize(mode); } largeobject_streambuf( //[t48] dbtransaction &T, oid O, openmode mode=std::ios::in|std::ios::out, size_type BufSize=512) : m_bufsize{BufSize}, m_obj{T, O, mode}, m_g{nullptr}, m_p{nullptr} { initialize(mode); } virtual ~largeobject_streambuf() noexcept { delete [] m_p; delete [] m_g; } /// For use by large object stream classes void process_notice(const std::string &s) { m_obj.process_notice(s); } protected: virtual int sync() override { // setg() sets eback, gptr, egptr this->setg(this->eback(), this->eback(), this->egptr()); return overflow(EoF()); } virtual pos_type seekoff( off_type offset, seekdir dir, openmode) override { return AdjustEOF(m_obj.cseek(largeobjectaccess::off_type(offset), dir)); } virtual pos_type seekpos(pos_type pos, openmode) override { const largeobjectaccess::pos_type newpos = m_obj.cseek( largeobjectaccess::off_type(pos), std::ios::beg); return AdjustEOF(newpos); } virtual int_type overflow(int_type ch = EoF()) override { char *const pp = this->pptr(); if (pp == nullptr) return EoF(); char *const pb = this->pbase(); int_type res = 0; if (pp > pb) res = int_type(AdjustEOF(m_obj.cwrite(pb, pp-pb))); this->setp(m_p, m_p + m_bufsize); // Write that one more character, if it's there. if (ch != EoF()) { *this->pptr() = char(ch); this->pbump(1); } return res; } virtual int_type underflow() override { if (this->gptr() == nullptr) return EoF(); char *const eb = this->eback(); const int_type res(static_cast( AdjustEOF(m_obj.cread(this->eback(), m_bufsize)))); this->setg(eb, eb, eb + ((res==EoF()) ? 0 : res)); return ((res == 0) or (res == EoF())) ? EoF() : *eb; } private: /// Shortcut for traits_type::eof(). static int_type EoF() { return traits_type::eof(); } /// Helper: change error position of -1 to EOF (probably a no-op). template static std::streampos AdjustEOF(INTYPE pos) { return (pos==-1) ? std::streampos(EoF()) : std::streampos(pos); } void initialize(openmode mode) { if (mode & std::ios::in) { m_g = new char_type[unsigned(m_bufsize)]; this->setg(m_g, m_g, m_g); } if (mode & std::ios::out) { m_p = new char_type[unsigned(m_bufsize)]; this->setp(m_p, m_p + m_bufsize); } } const size_type m_bufsize; largeobjectaccess m_obj; /// Get & put buffers. char_type *m_g, *m_p; }; /// Input stream that gets its data from a large object. /** Use this class exactly as you would any other istream to read data from a * large object. All formatting and streaming operations of @c std::istream are * supported. What you'll typically want to use, however, is the ilostream * alias (which defines a basic_ilostream for @c char). This is similar to * how e.g. @c std::ifstream relates to @c std::basic_ifstream. * * Currently only works for >. */ template> class basic_ilostream : public std::basic_istream { using super = std::basic_istream; public: using char_type = CHAR; using traits_type = TRAITS; using int_type = typename traits_type::int_type; using pos_type = typename traits_type::pos_type; using off_type = typename traits_type::off_type; /// Create a basic_ilostream /** * @param T Transaction in which this stream is to exist * @param O Large object to access * @param BufSize Size of buffer to use internally (optional) */ basic_ilostream( //[t57] dbtransaction &T, largeobject O, largeobject::size_type BufSize=512) : super{nullptr}, m_buf{T, O, std::ios::in, BufSize} { super::init(&m_buf); } /// Create a basic_ilostream /** * @param T Transaction in which this stream is to exist * @param O Identifier of a large object to access * @param BufSize Size of buffer to use internally (optional) */ basic_ilostream( //[t48] dbtransaction &T, oid O, largeobject::size_type BufSize=512) : super{nullptr}, m_buf{T, O, std::ios::in, BufSize} { super::init(&m_buf); } private: largeobject_streambuf m_buf; }; using ilostream = basic_ilostream; /// Output stream that writes data back to a large object /** Use this class exactly as you would any other ostream to write data to a * large object. All formatting and streaming operations of @c std::ostream are * supported. What you'll typically want to use, however, is the olostream * alias (which defines a basic_olostream for @c char). This is similar to * how e.g. @c std::ofstream is related to @c std::basic_ofstream. * * Currently only works for >. */ template> class basic_olostream : public std::basic_ostream { using super = std::basic_ostream; public: using char_type = CHAR; using traits_type = TRAITS; using int_type = typename traits_type::int_type; using pos_type = typename traits_type::pos_type; using off_type = typename traits_type::off_type; /// Create a basic_olostream /** * @param T transaction in which this stream is to exist * @param O a large object to access * @param BufSize size of buffer to use internally (optional) */ basic_olostream( //[t48] dbtransaction &T, largeobject O, largeobject::size_type BufSize=512) : super{nullptr}, m_buf{T, O, std::ios::out, BufSize} { super::init(&m_buf); } /// Create a basic_olostream /** * @param T transaction in which this stream is to exist * @param O a large object to access * @param BufSize size of buffer to use internally (optional) */ basic_olostream( //[t57] dbtransaction &T, oid O, largeobject::size_type BufSize=512) : super{nullptr}, m_buf{T, O, std::ios::out, BufSize} { super::init(&m_buf); } ~basic_olostream() { try { m_buf.pubsync(); m_buf.pubsync(); } catch (const std::exception &e) { m_buf.process_notice(e.what()); } } private: largeobject_streambuf m_buf; }; using olostream = basic_olostream; /// Stream that reads and writes a large object /** Use this class exactly as you would a std::iostream to read data from, or * write data to a large object. All formatting and streaming operations of * @c std::iostream are supported. What you'll typically want to use, however, * is the lostream alias (which defines a basic_lostream for @c char). This * is similar to how e.g. @c std::fstream is related to @c std::basic_fstream. * * Currently only works for >. */ template> class basic_lostream : public std::basic_iostream { using super = std::basic_iostream; public: using char_type = CHAR; using traits_type = TRAITS; using int_type = typename traits_type::int_type; using pos_type = typename traits_type::pos_type; using off_type = typename traits_type::off_type; /// Create a basic_lostream /** * @param T Transaction in which this stream is to exist * @param O Large object to access * @param BufSize Size of buffer to use internally (optional) */ basic_lostream( //[t59] dbtransaction &T, largeobject O, largeobject::size_type BufSize=512) : super{nullptr}, m_buf{T, O, std::ios::in | std::ios::out, BufSize} { super::init(&m_buf); } /// Create a basic_lostream /** * @param T Transaction in which this stream is to exist * @param O Large object to access * @param BufSize Size of buffer to use internally (optional) */ basic_lostream( //[t59] dbtransaction &T, oid O, largeobject::size_type BufSize=512) : super{nullptr}, m_buf{T, O, std::ios::in | std::ios::out, BufSize} { super::init(&m_buf); } ~basic_lostream() { try { m_buf.pubsync(); m_buf.pubsync(); } catch (const std::exception &e) { m_buf.process_notice(e.what()); } } private: largeobject_streambuf m_buf; }; using lostream = basic_lostream; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/nontransaction000066400000000000000000000003311350065432700206250ustar00rootroot00000000000000/** pqxx::nontransaction class. * * pqxx::nontransaction provides nontransactional database access. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/nontransaction.hxx" libpqxx-6.4.5/include/pqxx/nontransaction.hxx000066400000000000000000000056421350065432700214450ustar00rootroot00000000000000/** Definition of the pqxx::nontransaction class. * * pqxx::nontransaction provides nontransactional database access * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/nontransaction instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_NONTRANSACTION #define PQXX_H_NONTRANSACTION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/connection_base.hxx" #include "pqxx/result.hxx" #include "pqxx/transaction_base.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { /// Simple "transaction" class offering no transactional integrity. /** * @ingroup transaction * * nontransaction, like transaction or any other transaction_base-derived class, * provides access to a database through a connection. Unlike its siblings, * however, nontransaction does not maintain any kind of transactional * integrity. This may be useful eg. for read-only access to the database that * does not require a consistent, atomic view on its data; or for operations * that are not allowed within a backend transaction, such as creating tables. * * For queries that update the database, however, a real transaction is likely * to be faster unless the transaction consists of only a single record update. * * Also, you can keep a nontransaction open for as long as you like. Actual * back-end transactions are limited in lifespan, and will sometimes fail just * because they took too long to execute or were left idle for too long. This * will not happen with a nontransaction (although the connection may still time * out, e.g. when the network is unavailable for a very long time). * * Any query executed in a nontransaction is committed immediately, and neither * commit() nor abort() has any effect. * * Database features that require a backend transaction, such as cursors or * large objects, will not work in a nontransaction. */ class PQXX_LIBEXPORT nontransaction : public transaction_base { public: /// Constructor. /** Create a "dummy" transaction. * @param C Connection that this "transaction" will operate on. * @param Name Optional name for the transaction, beginning with a letter * and containing only letters and digits. */ explicit nontransaction( //[t14] connection_base &C, const std::string &Name=std::string{}) : namedclass{"nontransaction", Name}, transaction_base{C} { Begin(); } virtual ~nontransaction(); //[t14] private: virtual void do_begin() override {} //[t14] virtual result do_exec(const char C[]) override; //[t14] virtual void do_commit() override {} //[t14] virtual void do_abort() override {} //[t14] }; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/notification000066400000000000000000000003461350065432700202610ustar00rootroot00000000000000/** pqxx::notification_receiver functor interface. * * pqxx::notification_receiver handles incoming notifications. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/notification.hxx" libpqxx-6.4.5/include/pqxx/notification.hxx000066400000000000000000000067131350065432700210730ustar00rootroot00000000000000/** Definition of the pqxx::notification_receiver functor interface. * * pqxx::notification_receiver handles incoming notifications. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/notification instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_NOTIFICATION #define PQXX_H_NOTIFICATION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include "pqxx/types.hxx" namespace pqxx { /// "Observer" base class for notifications. /** @addtogroup notification Notifications and Receivers * * To listen on a notification issued using the NOTIFY command, derive your own * class from notification_receiver and define its function-call operator to * perform whatever action you wish to take when the given notification arrives. * Then create an object of that class and pass it to your connection. DO NOT * use raw SQL to listen for notifications, or your attempts to listen won't be * resumed when a connection fails--and you'll have no way to notice. * * Notifications never arrive inside a transaction, not even in a * nontransaction. Therefore, you are free to open a transaction of your own * inside your receiver's function invocation operator. * * Notifications you are listening for may arrive anywhere within libpqxx code, * but be aware that @b PostgreSQL @b defers @b notifications @b occurring * @b inside @b transactions. (This was done for excellent reasons; just think * about what happens if the transaction where you happen to handle an incoming * notification is later rolled back for other reasons). So if you're keeping a * transaction open, don't expect any of your receivers on the same connection * to be notified. * * (For very similar reasons, outgoing notifications are also not sent until the * transaction that sends them commits.) * * Multiple receivers on the same connection may listen on a notification of the * same name. An incoming notification is processed by invoking all receivers * (zero or more) of the same name. */ class PQXX_LIBEXPORT PQXX_NOVTABLE notification_receiver { public: /// Register the receiver with a connection. /** * @param c Connnection to operate on. * @param channel Name of the notification to listen for. */ notification_receiver(connection_base &c, const std::string &channel); notification_receiver(const notification_receiver &) =delete; notification_receiver &operator=(const notification_receiver &) =delete; virtual ~notification_receiver(); /// The channel that this receiver listens on. const std::string &channel() const { return m_channel; } /// Overridable: action to invoke when notification arrives. /** * @param payload On PostgreSQL 9.0 or later, an optional string that may have * been passed to the NOTIFY command. * @param backend_pid Process ID of the database backend process that served * our connection when the notification arrived. The actual process ID behind * the connection may have changed by the time this method is called. */ virtual void operator()(const std::string &payload, int backend_pid) =0; protected: connection_base &conn() const noexcept { return m_conn; } private: connection_base &m_conn; std::string m_channel; }; } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/pipeline000066400000000000000000000002631350065432700173760ustar00rootroot00000000000000/** pqxx::pipeline class. * * Throughput-optimized query interface. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/pipeline.hxx" libpqxx-6.4.5/include/pqxx/pipeline.hxx000066400000000000000000000163161350065432700202120ustar00rootroot00000000000000/** Definition of the pqxx::pipeline class. * * Throughput-optimized query manager * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/pipeline instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_PIPELINE #define PQXX_H_PIPELINE #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include #include #include "pqxx/transaction_base.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { /// Processes several queries in FIFO manner, optimized for high throughput /** Use a pipeline if you want to execute queries without always sitting still * while they execute. Result retrieval is decoupled from execution request; * queries "go in at the front" and results "come out the back." Actually * results may be retrieved in any order, if you want. * * Feel free to pump as many queries into the pipeline as possible, even if they * were generated after looking at a result from the same pipeline. To get the * best possible throughput, try to make insertion of queries run as far ahead * of results retrieval as possible; issue each query as early as possible and * retrieve their results as late as possible, so the pipeline has as many * ongoing queries as possible at any given time. In other words, keep it busy! * * One warning: if any of the queries you insert leads to a syntactic error, the * error may be returned as if it were generated by an older query. Future * versions may try to work around this if working in a nontransaction. */ class PQXX_LIBEXPORT pipeline : public internal::transactionfocus { public: using query_id = long; pipeline(const pipeline &) =delete; pipeline &operator=(const pipeline &) =delete; explicit pipeline( //[t69] transaction_base &, const std::string &Name=std::string{}); ~pipeline() noexcept; /// Add query to the pipeline. /** Queries are accumulated in the pipeline and sent to the backend in a * concatenated format, separated by semicolons. The queries you insert must * not use this construct themselves, or the pipeline will get hopelessly * confused! * @return Identifier for this query, unique only within this pipeline */ query_id insert(const std::string &); //[t69] /// Wait for all ongoing or pending operations to complete. /** Detaches from the transaction when done. */ void complete(); //[t71] /// Forget all ongoing or pending operations and retrieved results /** Queries already sent to the backend may still be completed, depending * on implementation and timing. * * Any error state (unless caused by an internal error) will also be cleared. * This is mostly useful in a nontransaction, since a backend transaction is * aborted automatically when an error occurs. * * Detaches from the transaction when done. */ void flush(); //[t70] /// Cancel ongoing query, if any. /** May cancel any or all of the queries that have been inserted at this point * whose results have not yet been retrieved. If the pipeline lives in a * backend transaction, that transaction may be left in a nonfunctional state * in which it can only be aborted. * * Therefore, either use this function in a nontransaction, or abort the * transaction after calling it. */ void cancel(); /// Is result for given query available? bool is_finished(query_id) const; //[t71] /// Retrieve result for given query. /** If the query failed for whatever reason, this will throw an exception. * The function will block if the query has not finished yet. * @warning If results are retrieved out-of-order, i.e. in a different order * than the one in which their queries were inserted, errors may "propagate" * to subsequent queries. */ result retrieve(query_id qid) //[t71] { return retrieve(m_queries.find(qid)).second; } /// Retrieve oldest unretrieved result (possibly wait for one) /** @return The query's identifier and its result set */ std::pair retrieve(); //[t69] bool empty() const noexcept { return m_queries.empty(); } //[t69] /// Set maximum number of queries to retain before issuing them to the backend /** The pipeline will perform better if multiple queries are issued at once, * but retaining queries until the results are needed (as opposed to issuing * them to the backend immediately) may negate any performance benefits the * pipeline can offer. * * Recommended practice is to set this value no higher than the number of * queries you intend to insert at a time. * @param retain_max A nonnegative "retention capacity;" passing zero will * cause queries to be issued immediately * @return Old retention capacity */ int retain(int retain_max=2); //[t70] /// Resume retained query emission (harmless when not needed) void resume(); //[t70] private: class PQXX_PRIVATE Query { public: explicit Query(const std::string &q) : m_query{q}, m_res{} {} const result &get_result() const noexcept { return m_res; } void set_result(const result &r) noexcept { m_res = r; } const std::string &get_query() const noexcept { return m_query; } private: std::string m_query; result m_res; }; using QueryMap = std::map; void attach(); void detach(); /// Upper bound to query id's static constexpr query_id qid_limit() noexcept { // Parenthesise this to work around an eternal Visual C++ problem: // Without the extra parentheses, unless NOMINMAX is defined, the // preprocessor will mistake this "max" for its annoying built-in macro // of the same name. return (std::numeric_limits::max)(); } /// Create new query_id PQXX_PRIVATE query_id generate_id(); bool have_pending() const noexcept { return m_issuedrange.second != m_issuedrange.first; } PQXX_PRIVATE void issue(); /// The given query failed; never issue anything beyond that void set_error_at(query_id qid) noexcept { if (qid < m_error) m_error = qid; } /// Throw pqxx::internal_error. [[noreturn]] PQXX_PRIVATE void internal_error(const std::string &err); PQXX_PRIVATE bool obtain_result(bool expect_none=false); PQXX_PRIVATE void obtain_dummy(); PQXX_PRIVATE void get_further_available_results(); PQXX_PRIVATE void check_end_results(); /// Receive any results that happen to be available; it's not urgent PQXX_PRIVATE void receive_if_available(); /// Receive results, up to stop if possible PQXX_PRIVATE void receive(pipeline::QueryMap::const_iterator stop); std::pair retrieve(pipeline::QueryMap::iterator); QueryMap m_queries; std::pair m_issuedrange; int m_retain = 0; int m_num_waiting = 0; query_id m_q_id = 0; /// Is there a "dummy query" pending? bool m_dummy_pending = false; /// Point at which an error occurred; no results beyond it will be available query_id m_error = qid_limit(); }; } // namespace #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/pqxx000066400000000000000000000010531350065432700165670ustar00rootroot00000000000000/// Convenience header: include all libpqxx definitions. #include "pqxx/array" #include "pqxx/binarystring" #include "pqxx/connection" #include "pqxx/cursor" #include "pqxx/errorhandler" #include "pqxx/except" #include "pqxx/largeobject" #include "pqxx/nontransaction" #include "pqxx/notification" #include "pqxx/pipeline" #include "pqxx/prepared_statement" #include "pqxx/result" #include "pqxx/robusttransaction" #include "pqxx/stream_from" #include "pqxx/stream_to" #include "pqxx/subtransaction" #include "pqxx/transaction" #include "pqxx/transactor" libpqxx-6.4.5/include/pqxx/prepared_statement000066400000000000000000000004051350065432700214550ustar00rootroot00000000000000/** Helper classes for defining and executing prepared statements. * * See the connection_base hierarchy for more about prepared statements */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/prepared_statement.hxx" libpqxx-6.4.5/include/pqxx/prepared_statement.hxx000066400000000000000000000131751350065432700222730ustar00rootroot00000000000000/** Helper classes for defining and executing prepared statements. * * See the connection_base hierarchy for more about prepared statements. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_PREPARED_STATEMENT #define PQXX_H_PREPARED_STATEMENT #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/types.hxx" #include "pqxx/internal/statement_parameters.hxx" namespace pqxx { /// Dedicated namespace for helper types related to prepared statements. namespace prepare { /// Pass a number of statement parameters only known at runtime. /** When you call any of the @c exec_params functions, the number of arguments * is normally known at compile time. This helper function supports the case * where it is not. * * Use this function to pass a variable number of parameters, based on a * sequence ranging from @c begin to @c end exclusively. * * The technique combines with the regular static parameters. You can use it * to insert dynamic parameter lists in any place, or places, among the call's * parameters. You can even insert multiple dynamic sequences. * * @param begin A pointer or iterator for iterating parameters. * @param end A pointer or iterator for iterating parameters. * @return An object representing the parameters. */ template inline pqxx::internal::dynamic_params make_dynamic_params(IT begin, IT end) { return pqxx::internal::dynamic_params(begin, end); } /// Pass a number of statement parameters only known at runtime. /** When you call any of the @c exec_params functions, the number of arguments * is normally known at compile time. This helper function supports the case * where it is not. * * Use this function to pass a variable number of parameters, based on a * container of parameter values. * * The technique combines with the regular static parameters. You can use it * to insert dynamic parameter lists in any place, or places, among the call's * parameters. You can even insert multiple dynamic containers. * * @param container A container of parameter values. * @return An object representing the parameters. */ template inline pqxx::internal::dynamic_params make_dynamic_params(const C &container) { return pqxx::internal::dynamic_params(container); } } // namespace prepare } // namespace pqxx namespace pqxx { namespace prepare { /// Helper class for passing parameters to, and executing, prepared statements /** @deprecated As of 6.0, use @c transaction_base::exec_prepared and friends. */ class PQXX_LIBEXPORT invocation : internal::statement_parameters { public: PQXX_DEPRECATED invocation(transaction_base &, const std::string &statement); invocation &operator=(const invocation &) =delete; /// Execute! result exec() const; /// Has a statement of this name been defined? bool exists() const; /// Pass null parameter. invocation &operator()() { add_param(); return *this; } /// Pass parameter value. /** * @param v parameter value; will be represented as a string internally. */ template invocation &operator()(const T &v) { add_param(v, true); return *this; } /// Pass binary parameter value for a BYTEA field. /** * @param v binary string; will be passed on directly in binary form. */ invocation &operator()(const binarystring &v) { add_binary_param(v, true); return *this; } /// Pass parameter value. /** * @param v parameter value (will be represented as a string internally). * @param nonnull replaces value with null if set to false. */ template invocation &operator()(const T &v, bool nonnull) { add_param(v, nonnull); return *this; } /// Pass binary parameter value for a BYTEA field. /** * @param v binary string; will be passed on directly in binary form. * @param nonnull determines whether to pass a real value, or nullptr. */ invocation &operator()(const binarystring &v, bool nonnull) { add_binary_param(v, nonnull); return *this; } /// Pass C-style parameter string, or null if pointer is null. /** * This version is for passing C-style strings; it's a template, so any * pointer type that @c to_string accepts will do. * * @param v parameter value (will be represented as a C++ string internally) * @param nonnull replaces value with null if set to @c false */ template invocation &operator()(T *v, bool nonnull=true) { add_param(v, nonnull); return *this; } /// Pass C-style string parameter, or null if pointer is null. /** This duplicates the pointer-to-template-argument-type version of the * operator, but helps compilers with less advanced template implementations * disambiguate calls where C-style strings are passed. */ invocation &operator()(const char *v, bool nonnull=true) { add_param(v, nonnull); return *this; } private: transaction_base &m_home; const std::string m_statement; invocation &setparam(const std::string &, bool nonnull); }; namespace internal { /// Internal representation of a prepared statement definition. struct PQXX_LIBEXPORT prepared_def { /// Text of prepared query. std::string definition; /// Has this prepared statement been prepared in the current session? bool registered = false; prepared_def() =default; explicit prepared_def(const std::string &); }; } // namespace pqxx::prepare::internal } // namespace pqxx::prepare } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/result000066400000000000000000000006421350065432700171100ustar00rootroot00000000000000/** pqxx::result class and support classes. * * pqxx::result represents the set of result rows from a database query. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/result.hxx" // Now include some types which depend on result, but which the user will // expect to see defined after including this header. #include "pqxx/result_iterator.hxx" #include "pqxx/field.hxx" libpqxx-6.4.5/include/pqxx/result.hxx000066400000000000000000000175461350065432700177310ustar00rootroot00000000000000/** Definitions for the pqxx::result class and support classes. * * pqxx::result represents the set of result rows from a database query. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/result instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_RESULT #define PQXX_H_RESULT #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include #include #include #include "pqxx/except.hxx" #include "pqxx/types.hxx" #include "pqxx/util.hxx" #include "pqxx/internal/encodings.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { namespace internal { PQXX_LIBEXPORT void clear_result(const pq::PGresult *); namespace gate { class result_connection; class result_creation; class result_row; class result_sql_cursor; } // namespace internal::gate } // namespace internal /// Result set containing data returned by a query or command. /** This behaves as a container (as defined by the C++ standard library) and * provides random access const iterators to iterate over its rows. A row * can also be accessed by indexing a result R by the row's zero-based * number: * * @code * for (result::size_type i=0; i < R.size(); ++i) Process(R[i]); * @endcode * * Result sets in libpqxx are lightweight, reference-counted wrapper objects * which are relatively small and cheap to copy. Think of a result object as * a "smart pointer" to an underlying result set. * * @warning The result set that a result object points to is not thread-safe. * If you copy a result object, it still refers to the same underlying result * set. So never copy, destroy, query, or otherwise access a result while * another thread may be copying, destroying, querying, or otherwise accessing * the same result set--even if it is doing so through a different result * object! */ class PQXX_LIBEXPORT result { public: using size_type = result_size_type; using difference_type = result_difference_type; using reference = row; using const_iterator = const_result_iterator; using pointer = const_iterator; using iterator = const_iterator; using const_reverse_iterator = const_reverse_result_iterator; using reverse_iterator = const_reverse_iterator; result() noexcept : //[t03] m_data(make_data_pointer()), m_query(), m_encoding(internal::encoding_group::MONOBYTE) {} result(const result &rhs) noexcept =default; //[t01] result &operator=(const result &rhs) noexcept =default; //[t10] /** * @name Comparisons */ //@{ bool operator==(const result &) const noexcept; //[t70] bool operator!=(const result &rhs) const noexcept //[t70] { return not operator==(rhs); } //@} const_reverse_iterator rbegin() const; //[t75] const_reverse_iterator crbegin() const; const_reverse_iterator rend() const; //[t75] const_reverse_iterator crend() const; const_iterator begin() const noexcept; //[t01] const_iterator cbegin() const noexcept; inline const_iterator end() const noexcept; //[t01] inline const_iterator cend() const noexcept; reference front() const noexcept; //[t74] reference back() const noexcept; //[t75] PQXX_PURE size_type size() const noexcept; //[t02] PQXX_PURE bool empty() const noexcept; //[t11] size_type capacity() const noexcept { return size(); } //[t20] void swap(result &) noexcept; //[t77] const row operator[](size_type i) const noexcept; //[t02] const row at(size_type) const; //[t10] void clear() noexcept { m_data.reset(); m_query = nullptr; } //[t20] /** * @name Column information */ //@{ /// Number of columns in result. PQXX_PURE row_size_type columns() const noexcept; //[t11] /// Number of given column (throws exception if it doesn't exist). row_size_type column_number(const char ColName[]) const; //[t11] /// Number of given column (throws exception if it doesn't exist). row_size_type column_number(const std::string &Name) const //[t11] {return column_number(Name.c_str());} /// Name of column with this number (throws exception if it doesn't exist) const char *column_name(row_size_type Number) const; //[t11] /// Type of given column oid column_type(row_size_type ColNum) const; //[t07] /// Type of given column oid column_type(int ColNum) const //[t07] { return column_type(row_size_type(ColNum)); } /// Type of given column oid column_type(const std::string &ColName) const //[t07] { return column_type(column_number(ColName)); } /// Type of given column oid column_type(const char ColName[]) const //[t07] { return column_type(column_number(ColName)); } /// What table did this column come from? oid column_table(row_size_type ColNum) const; //[t02] /// What table did this column come from? oid column_table(int ColNum) const //[t02] { return column_table(row_size_type(ColNum)); } /// What table did this column come from? oid column_table(const std::string &ColName) const //[t02] { return column_table(column_number(ColName)); } /// What column in its table did this column come from? row_size_type table_column(row_size_type ColNum) const; //[t93] /// What column in its table did this column come from? row_size_type table_column(int ColNum) const //[t93] { return table_column(row_size_type(ColNum)); } /// What column in its table did this column come from? row_size_type table_column(const std::string &ColName) const //[t93] { return table_column(column_number(ColName)); } //@} /// Query that produced this result, if available (empty string otherwise) PQXX_PURE const std::string &query() const noexcept; //[t70] /// If command was @c INSERT of 1 row, return oid of inserted row /** @return Identifier of inserted row if exactly one row was inserted, or * oid_none otherwise. */ PQXX_PURE oid inserted_oid() const; //[t13] /// If command was @c INSERT, @c UPDATE, or @c DELETE: number of affected rows /** @return Number of affected rows if last command was @c INSERT, @c UPDATE, * or @c DELETE; zero for all other commands. */ PQXX_PURE size_type affected_rows() const; //[t07] private: using data_pointer = std::shared_ptr; /// Underlying libpq result set. data_pointer m_data; /// Factory for data_pointer. static data_pointer make_data_pointer( const internal::pq::PGresult *res=nullptr) { return data_pointer{res, internal::clear_result}; } /// Query string. std::shared_ptr m_query; internal::encoding_group m_encoding; static const std::string s_empty_string; friend class pqxx::field; PQXX_PURE const char *GetValue(size_type Row, row_size_type Col) const; PQXX_PURE bool get_is_null(size_type Row, row_size_type Col) const; PQXX_PURE field_size_type get_length( size_type, row_size_type) const noexcept; friend class pqxx::internal::gate::result_creation; result( internal::pq::PGresult *rhs, const std::string &Query, internal::encoding_group enc); PQXX_PRIVATE void check_status() const; friend class pqxx::internal::gate::result_connection; friend class pqxx::internal::gate::result_row; bool operator!() const noexcept { return not m_data.get(); } operator bool() const noexcept { return m_data.get() != nullptr; } [[noreturn]] PQXX_PRIVATE void ThrowSQLError( const std::string &Err, const std::string &Query) const; PQXX_PRIVATE PQXX_PURE int errorposition() const; PQXX_PRIVATE std::string StatusError() const; friend class pqxx::internal::gate::result_sql_cursor; PQXX_PURE const char *cmd_status() const noexcept; }; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/result_iterator.hxx000066400000000000000000000175521350065432700216370ustar00rootroot00000000000000/** Definitions for the pqxx::result class and support classes. * * pqxx::result represents the set of result rows from a database query. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/result instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_RESULT_ITERATOR #define PQXX_H_RESULT_ITERATOR #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/row.hxx" /* Result iterator. * * Don't include this header from your own application; it is included for you * by other libpqxx headers. */ namespace pqxx { /// Iterator for rows in a result. Use as result::const_iterator. /** A result, once obtained, cannot be modified. Therefore there is no * plain iterator type for result. However its const_iterator type can be * used to inspect its rows without changing them. */ class PQXX_LIBEXPORT const_result_iterator : public row { public: using iterator_category = std::random_access_iterator_tag; using value_type = const row; using pointer = const row *; using reference = row; using size_type = result_size_type; using difference_type = result_difference_type; const_result_iterator() noexcept : row{result(), 0} {} const_result_iterator(const row &t) noexcept : row{t} {} /** * @name Dereferencing operators */ //@{ /** The iterator "points to" its own row, which is also itself. This * allows a result to be addressed as a two-dimensional container without * going through the intermediate step of dereferencing the iterator. I * hope this works out to be similar to C pointer/array semantics in useful * cases. * * IIRC Alex Stepanov, the inventor of the STL, once remarked that having * this as standard behaviour for pointers would be useful in some * algorithms. So even if this makes me look foolish, I would seem to be in * distinguished company. */ pointer operator->() const { return this; } //[t12] reference operator*() const { return row{*this}; } //[t12] //@} /** * @name Manipulations */ //@{ const_result_iterator operator++(int); //[t12] const_result_iterator &operator++() { ++m_index; return *this; } //[t01] const_result_iterator operator--(int); //[t12] const_result_iterator &operator--() { --m_index; return *this; } //[t12] const_result_iterator &operator+=(difference_type i) //[t12] { m_index += i; return *this; } const_result_iterator &operator-=(difference_type i) //[t12] { m_index -= i; return *this; } //@} /** * @name Comparisons */ //@{ bool operator==(const const_result_iterator &i) const //[t12] {return m_index==i.m_index;} bool operator!=(const const_result_iterator &i) const //[t12] {return m_index!=i.m_index;} bool operator<(const const_result_iterator &i) const //[t12] {return m_index(const const_result_iterator &i) const //[t12] {return m_index>i.m_index;} bool operator>=(const const_result_iterator &i) const //[t12] {return m_index>=i.m_index;} //@} /** * @name Arithmetic operators */ //@{ inline const_result_iterator operator+(difference_type) const; //[t12] friend const_result_iterator operator+( //[t12] difference_type, const_result_iterator); inline const_result_iterator operator-(difference_type) const; //[t12] inline difference_type operator-(const_result_iterator) const; //[t12] //@} private: friend class pqxx::result; const_result_iterator(const pqxx::result *r, result_size_type i) noexcept : row{*r, i} {} }; /// Reverse iterator for result. Use as result::const_reverse_iterator. class PQXX_LIBEXPORT const_reverse_result_iterator : private const_result_iterator { public: using super = const_result_iterator; using iterator_type = const_result_iterator; using iterator_type::iterator_category; using iterator_type::difference_type; using iterator_type::pointer; using value_type = iterator_type::value_type; using reference = iterator_type::reference; const_reverse_result_iterator( //[t75] const const_reverse_result_iterator &rhs) : const_result_iterator{rhs} {} explicit const_reverse_result_iterator( //[t75] const const_result_iterator &rhs) : const_result_iterator{rhs} { super::operator--(); } PQXX_PURE const_result_iterator base() const noexcept; //[t75] /** * @name Dereferencing operators */ //@{ using const_result_iterator::operator->; //[t75] using const_result_iterator::operator*; //[t75] //@} /** * @name Manipulations */ //@{ const_reverse_result_iterator &operator=( //[t75] const const_reverse_result_iterator &r) { iterator_type::operator=(r); return *this; } const_reverse_result_iterator &operator++() //[t75] { iterator_type::operator--(); return *this; } const_reverse_result_iterator operator++(int); //[t75] const_reverse_result_iterator &operator--() //[t75] { iterator_type::operator++(); return *this; } const_reverse_result_iterator operator--(int); //[t75] const_reverse_result_iterator &operator+=(difference_type i) //[t75] { iterator_type::operator-=(i); return *this; } const_reverse_result_iterator &operator-=(difference_type i) //[t75] { iterator_type::operator+=(i); return *this; } //@} /** * @name Arithmetic operators */ //@{ const_reverse_result_iterator operator+(difference_type i) const //[t75] { return const_reverse_result_iterator(base() - i); } const_reverse_result_iterator operator-(difference_type i) //[t75] { return const_reverse_result_iterator(base() + i); } difference_type operator-( //[t75] const const_reverse_result_iterator &rhs) const { return rhs.const_result_iterator::operator-(*this); } //@} /** * @name Comparisons */ //@{ bool operator==( //[t75] const const_reverse_result_iterator &rhs) const noexcept { return iterator_type::operator==(rhs); } bool operator!=( //[t75] const const_reverse_result_iterator &rhs) const noexcept { return not operator==(rhs); } bool operator<(const const_reverse_result_iterator &rhs) const //[t75] { return iterator_type::operator>(rhs); } bool operator<=(const const_reverse_result_iterator &rhs) const //[t75] { return iterator_type::operator>=(rhs); } bool operator>(const const_reverse_result_iterator &rhs) const //[t75] { return iterator_type::operator<(rhs); } bool operator>=(const const_reverse_result_iterator &rhs) const //[t75] { return iterator_type::operator<=(rhs); } //@} }; inline const_result_iterator const_result_iterator::operator+(result::difference_type o) const { return const_result_iterator{ &m_result, size_type(result::difference_type(m_index) + o)}; } inline const_result_iterator operator+(result::difference_type o, const_result_iterator i) { return i + o; } inline const_result_iterator const_result_iterator::operator-(result::difference_type o) const { return const_result_iterator{ &m_result, result_size_type(result::difference_type(m_index) - o)}; } inline result::difference_type const_result_iterator::operator-(const_result_iterator i) const { return result::difference_type(num() - i.num()); } inline const_result_iterator result::end() const noexcept { return const_result_iterator{this, size()}; } inline const_result_iterator result::cend() const noexcept { return end(); } inline const_reverse_result_iterator operator+( result::difference_type n, const const_reverse_result_iterator &i) { return const_reverse_result_iterator{i.base() - n}; } } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/robusttransaction000066400000000000000000000003401350065432700213510ustar00rootroot00000000000000/** pqxx::robusttransaction class. * * pqxx::robusttransaction is a slower but safer transaction class. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/robusttransaction.hxx" libpqxx-6.4.5/include/pqxx/robusttransaction.hxx000066400000000000000000000152211350065432700221630ustar00rootroot00000000000000/** Definition of the pqxx::robusttransaction class. * * pqxx::robusttransaction is a slower but safer transaction class. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/robusttransaction instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_ROBUSTTRANSACTION #define PQXX_H_ROBUSTTRANSACTION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/dbtransaction.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { namespace internal { /// Helper base class for the @c robusttransaction class template. class PQXX_LIBEXPORT PQXX_NOVTABLE basic_robusttransaction : public dbtransaction { public: /// Isolation level is read_committed by default. using isolation_tag = isolation_traits; virtual ~basic_robusttransaction() =0; //[t16] protected: basic_robusttransaction( connection_base &C, const std::string &IsolationLevel, const std::string &table_name=std::string{}); //[t16] private: using IDType = unsigned long; IDType m_record_id = 0; std::string m_xid; std::string m_log_table; std::string m_sequence; int m_backendpid = -1; virtual void do_begin() override; //[t18] virtual void do_commit() override; //[t16] virtual void do_abort() override; //[t18] PQXX_PRIVATE void CreateLogTable(); PQXX_PRIVATE void CreateTransactionRecord(); PQXX_PRIVATE std::string sql_delete() const; PQXX_PRIVATE void DeleteTransactionRecord() noexcept; PQXX_PRIVATE bool CheckTransactionRecord(); }; } // namespace internal /** * @ingroup transaction * * @{ */ /// Slightly slower, better-fortified version of transaction /** robusttransaction is similar to transaction, but spends more effort (and * performance!) to deal with the hopefully rare case that the connection to * the backend is lost just as the current transaction is being committed. In * this case, there is no way to determine whether the backend managed to * commit the transaction before noticing the loss of connection. * * In such cases, this class tries to reconnect to the database and figure out * what happened. It will need to store and manage some information (pretty * much a user-level transaction log) in the back-end for each and every * transaction just on the off chance that this problem might occur. * This service level was made optional since you may not want to pay this * overhead where it is not necessary. Certainly the use of this class makes * no sense for local connections, or for transactions that read the database * but never modify it, or for noncritical database manipulations. * * Besides being slower, it's theoretically possible that robusttransaction * actually fails more instead of less often than a normal transaction. This is * due to the added work and complexity. What robusttransaction tries to * achieve is to be more deterministic, not more successful per se. * * When a user first uses a robusttransaction in a database, the class will * attempt to create a log table there to keep vital transaction-related state * information in. This table, located in that same database, will be called * pqxxlog_*user*, where *user* is the PostgreSQL username for that user. If * the log table can not be created, the transaction fails immediately. * * If the user does not have permission to create the log table, the database * administrator may create one for him beforehand, and give ownership (or at * least full insert/update rights) to the user. The table must contain two * non-unique fields (which will never be null): "name" (of text type, * @c varchar(256) by default) and "date" (of @c timestamp type). Older * versions of robusttransaction also added a unique "id" field; this field is * now obsolete and the log table's implicit oids are used instead. The log * tables' names may be made configurable in a future version of libpqxx. * * The transaction log table contains records describing unfinished * transactions, i.e. ones that have been started but not, as far as the client * knows, committed or aborted. This can mean any of the following: * *
    *
  1. The transaction is in progress. Since backend transactions can't run * for extended periods of time, this can only be the case if the log record's * timestamp (compared to the server's clock) is not very old, provided of * course that the server's system clock hasn't just made a radical jump. *
  2. The client's connection to the server was lost, just when the client was * committing the transaction, and the client so far has not been able to * re-establish the connection to verify whether the transaction was actually * completed or rolled back by the server. This is a serious (and luckily a * rare) condition and requires manual inspection of the database to determine * what happened. The robusttransaction will emit clear and specific warnings * to this effect, and will identify the log record describing the transaction * in question. *
  3. The transaction was completed (either by commit or by rollback), but the * client's connection was durably lost just as it tried to clean up the log * record. Again, robusttransaction will emit a clear and specific warning to * tell you about this and request that the record be deleted as soon as * possible. *
  4. The client has gone offline at any time while in one of the preceding * states. This also requires manual intervention, but the client obviously is * not able to issue a warning. *
* * It is safe to drop a log table when it is not in use (ie., it is empty or all * records in it represent states 2-4 above). Each robusttransaction will * attempt to recreate the table at its next time of use. */ template class robusttransaction : public internal::basic_robusttransaction { public: using isolation_tag = isolation_traits; /// Constructor /** Creates robusttransaction of given name * @param C Connection that this robusttransaction should live inside. * @param Name optional human-readable name for this transaction */ explicit robusttransaction( connection_base &C, const std::string &Name=std::string{}) : namedclass{fullname("robusttransaction",isolation_tag::name()), Name}, internal::basic_robusttransaction(C, isolation_tag::name()) { Begin(); } virtual ~robusttransaction() noexcept { End(); } }; /** * @} */ } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/row000066400000000000000000000003051350065432700163750ustar00rootroot00000000000000/** pqxx::row class. * * pqxx::row refers to a row in a result. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/result.hxx" #include "pqxx/row.hxx" libpqxx-6.4.5/include/pqxx/row.hxx000066400000000000000000000321751350065432700172150ustar00rootroot00000000000000/** Definitions for the pqxx::result class and support classes. * * pqxx::result represents the set of result rows from a database query. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/result instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_ROW #define PQXX_H_ROW #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/except.hxx" #include "pqxx/field.hxx" #include "pqxx/result.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { /// Reference to one row in a result. /** A row represents one row (also called a row) in a query result set. * It also acts as a container mapping column numbers or names to field * values (see below): * * @code * cout << row["date"].c_str() << ": " << row["name"].c_str() << endl; * @endcode * * The row itself acts like a (non-modifyable) container, complete with its * own const_iterator and const_reverse_iterator. */ class PQXX_LIBEXPORT row { public: using size_type = row_size_type; using difference_type = row_difference_type; using const_iterator = const_row_iterator; using iterator = const_iterator; using reference = field; using pointer = const_row_iterator; using const_reverse_iterator = const_reverse_row_iterator; using reverse_iterator = const_reverse_iterator; row() =default; /// @deprecated Do not use this constructor. It will become private. row(result r, size_t i) noexcept; ~row() noexcept =default; // Yes Scott Meyers, you're absolutely right[1] /** * @name Comparison */ //@{ PQXX_PURE bool operator==(const row &) const noexcept; //[t75] bool operator!=(const row &rhs) const noexcept //[t75] { return not operator==(rhs); } //@} const_iterator begin() const noexcept; //[t82] const_iterator cbegin() const noexcept; const_iterator end() const noexcept; //[t82] const_iterator cend() const noexcept; /** * @name Field access */ //@{ reference front() const noexcept; //[t74] reference back() const noexcept; //[t75] const_reverse_row_iterator rbegin() const; //[t82] const_reverse_row_iterator crbegin() const; const_reverse_row_iterator rend() const; //[t82] const_reverse_row_iterator crend() const; reference operator[](size_type) const noexcept; //[t11] reference operator[](int) const noexcept; //[t02] /** Address field by name. * @warning This is much slower than indexing by number, or iterating. */ reference operator[](const char[]) const; //[t11] /** Address field by name. * @warning This is much slower than indexing by number, or iterating. */ reference operator[](const std::string &) const; //[t11] reference at(size_type) const; //[t11] reference at(int) const; //[t11] /** Address field by name. * @warning This is much slower than indexing by number, or iterating. */ reference at(const char[]) const; //[t11] /** Address field by name. * @warning This is much slower than indexing by number, or iterating. */ reference at(const std::string &) const; //[t11] //@} size_type size() const noexcept //[t11] { return m_end-m_begin; } void swap(row &) noexcept; //[t11] /// Row number, assuming this is a real row and not end()/rend(). size_t rownumber() const noexcept { return size_t(m_index); } //[t11] /** * @name Column information */ //@{ /// Number of given column (throws exception if it doesn't exist) size_type column_number(const std::string &ColName) const //[t30] { return column_number(ColName.c_str()); } /// Number of given column (throws exception if it doesn't exist) size_type column_number(const char[]) const; //[t30] /// Type of given column oid column_type(size_type) const; //[t07] /// Type of given column oid column_type(int ColNum) const //[t07] { return column_type(size_type(ColNum)); } /// Type of given column oid column_type(const std::string &ColName) const //[t07] { return column_type(column_number(ColName)); } /// Type of given column oid column_type(const char ColName[]) const //[t07] { return column_type(column_number(ColName)); } /// What table did this column come from? oid column_table(size_type ColNum) const; //[t02] /// What table did this column come from? oid column_table(int ColNum) const //[t02] { return column_table(size_type(ColNum)); } /// What table did this column come from? oid column_table(const std::string &ColName) const //[t02] { return column_table(column_number(ColName)); } /// What column number in its table did this result column come from? /** A meaningful answer can be given only if the column in question comes * directly from a column in a table. If the column is computed in any * other way, a logic_error will be thrown. * * @param ColNum a zero-based column number in this result set * @return a zero-based column number in originating table */ size_type table_column(size_type) const; //[t93] /// What column number in its table did this result column come from? size_type table_column(int ColNum) const //[t93] { return table_column(size_type(ColNum)); } /// What column number in its table did this result column come from? size_type table_column(const std::string &ColName) const //[t93] { return table_column(column_number(ColName)); } //@} size_t num() const { return rownumber(); } //[t01] /** Produce a slice of this row, containing the given range of columns. * * The slice runs from the range's starting column to the range's end * column, exclusive. It looks just like a normal result row, except * slices can be empty. * * @warning Slicing is a relatively new feature, and not all software may be * prepared to deal with empty slices. If there is any chance that your * program might be creating empty slices and passing them to code that may * not be designed with the possibility of empty rows in mind, be sure to * test for that case. */ row slice(size_type Begin, size_type End) const; // Is this an empty slice? PQXX_PURE bool empty() const noexcept; protected: friend class field; /// Result set of which this is one row. result m_result; /// Row number. /** * You'd expect this to be a size_t, but due to the way reverse iterators * are related to regular iterators, it must be allowed to underflow to -1. */ long m_index = 0; /// First column in slice. This row ignores lower-numbered columns. size_type m_begin = 0; /// End column in slice. This row only sees lower-numbered columns. size_type m_end = 0; }; /// Iterator for fields in a row. Use as row::const_iterator. class PQXX_LIBEXPORT const_row_iterator : public field { public: using iterator_category = std::random_access_iterator_tag; using value_type = const field; using pointer = const field *; using size_type = row_size_type; using difference_type = row_difference_type; using reference = field; const_row_iterator(const row &T, row_size_type C) noexcept : //[t82] field{T, C} {} const_row_iterator(const field &F) noexcept : field{F} {} //[t82] /** * @name Dereferencing operators */ //@{ pointer operator->() const { return this; } //[t82] reference operator*() const { return field{*this}; } //[t82] //@} /** * @name Manipulations */ //@{ const_row_iterator operator++(int); //[t82] const_row_iterator &operator++() { ++m_col; return *this; } //[t82] const_row_iterator operator--(int); //[t82] const_row_iterator &operator--() { --m_col; return *this; } //[t82] const_row_iterator &operator+=(difference_type i) //[t82] { m_col = size_type(difference_type(m_col) + i); return *this; } const_row_iterator &operator-=(difference_type i) //[t82] { m_col = size_type(difference_type(m_col) - i); return *this; } //@} /** * @name Comparisons */ //@{ bool operator==(const const_row_iterator &i) const //[t82] {return col()==i.col();} bool operator!=(const const_row_iterator &i) const //[t82] {return col()!=i.col();} bool operator<(const const_row_iterator &i) const //[t82] {return col()(const const_row_iterator &i) const //[t82] {return col()>i.col();} bool operator>=(const const_row_iterator &i) const //[t82] {return col()>=i.col();} //@} /** * @name Arithmetic operators */ //@{ inline const_row_iterator operator+(difference_type) const; //[t82] friend const_row_iterator operator+( //[t82] difference_type, const_row_iterator); inline const_row_iterator operator-(difference_type) const; //[t82] inline difference_type operator-(const_row_iterator) const; //[t82] //@} }; /// Reverse iterator for a row. Use as row::const_reverse_iterator. class PQXX_LIBEXPORT const_reverse_row_iterator : private const_row_iterator { public: using super = const_row_iterator; using iterator_type = const_row_iterator; using iterator_type::iterator_category; using iterator_type::difference_type; using iterator_type::pointer; using value_type = iterator_type::value_type; using reference = iterator_type::reference; const_reverse_row_iterator(const const_reverse_row_iterator &r) : //[t82] const_row_iterator{r} {} explicit const_reverse_row_iterator(const super &rhs) noexcept : //[t82] const_row_iterator{rhs} { super::operator--(); } PQXX_PURE iterator_type base() const noexcept; //[t82] /** * @name Dereferencing operators */ //@{ using iterator_type::operator->; //[t82] using iterator_type::operator*; //[t82] //@} /** * @name Manipulations */ //@{ const_reverse_row_iterator & operator=(const const_reverse_row_iterator &r) //[t82] { iterator_type::operator=(r); return *this; } const_reverse_row_iterator operator++() //[t82] { iterator_type::operator--(); return *this; } const_reverse_row_iterator operator++(int); //[t82] const_reverse_row_iterator &operator--() //[t82] { iterator_type::operator++(); return *this; } const_reverse_row_iterator operator--(int); //[t82] const_reverse_row_iterator &operator+=(difference_type i) //[t82] { iterator_type::operator-=(i); return *this; } const_reverse_row_iterator &operator-=(difference_type i) //[t82] { iterator_type::operator+=(i); return *this; } //@} /** * @name Arithmetic operators */ //@{ const_reverse_row_iterator operator+(difference_type i) const //[t82] { return const_reverse_row_iterator{base()-i}; } const_reverse_row_iterator operator-(difference_type i) //[t82] { return const_reverse_row_iterator{base()+i}; } difference_type operator-(const const_reverse_row_iterator &rhs) const //[t82] { return rhs.const_row_iterator::operator-(*this); } //@} /** * @name Comparisons */ //@{ bool operator==(const const_reverse_row_iterator &rhs) const noexcept //[t82] { return iterator_type::operator==(rhs); } bool operator!=(const const_reverse_row_iterator &rhs) const noexcept //[t82] { return !operator==(rhs); } bool operator<(const const_reverse_row_iterator &rhs) const //[t82] { return iterator_type::operator>(rhs); } bool operator<=(const const_reverse_row_iterator &rhs) const //[t82] { return iterator_type::operator>=(rhs); } bool operator>(const const_reverse_row_iterator &rhs) const //[t82] { return iterator_type::operator<(rhs); } bool operator>=(const const_reverse_row_iterator &rhs) const //[t82] { return iterator_type::operator<=(rhs); } //@} }; inline const_row_iterator const_row_iterator::operator+(difference_type o) const { return const_row_iterator{ row(home(), idx()), size_type(difference_type(col()) + o)}; } inline const_row_iterator operator+(const_row_iterator::difference_type o, const_row_iterator i) { return i + o; } inline const_row_iterator const_row_iterator::operator-(difference_type o) const { return const_row_iterator{ row(home(), idx()), size_type(difference_type(col()) - o)}; } inline const_row_iterator::difference_type const_row_iterator::operator-(const_row_iterator i) const { return difference_type(num() - i.num()); } } // namespace pqxx /* [1] Scott Meyers, in one of his essential books, "Effective C++" and "More Effective C++", points out that it is good style to have any class containing a member of pointer type define a destructor--just to show that it knows what it is doing with the pointer. This helps prevent nasty memory leak / double deletion bugs typically resulting from programmers' omission to deal with such issues in their destructors. The @c -Weffc++ option in gcc generates warnings for noncompliance with Scott's style guidelines, and hence necessitates the definition of this destructor, trivial as it may be. */ #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/strconv000066400000000000000000000002171350065432700172660ustar00rootroot00000000000000/** String conversion definitions. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/strconv.hxx" libpqxx-6.4.5/include/pqxx/strconv.hxx000066400000000000000000000300431350065432700200740ustar00rootroot00000000000000/** String conversion definitions. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/stringconv instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_STRINGCONV #define PQXX_H_STRINGCONV #include "pqxx/compiler-public.hxx" #include #include #include namespace pqxx { /** * @defgroup stringconversion String conversion * * The PostgreSQL server accepts and represents data in string form. It has * its own formats for various data types. The string conversions define how * various C++ types translate to and from their respective PostgreSQL text * representations. * * Each conversion is defined by a specialisation of the @c string_traits * template. This template implements some basic functions to support the * conversion, ideally in both directions. * * If you need to convert a type which is not supported out of the box, define * your own @c string_traits specialisation for that type, similar to the ones * defined here. Any conversion code which "sees" your specialisation will now * support your conversion. In particular, you'll be able to read result * fields into a variable of the new type. * * There is a macro to help you define conversions for individual enumeration * types. The conversion will represent enumeration values as numeric strings. */ //@{ /// Traits class for use in string conversions /** Specialize this template for a type that you wish to add to_string and * from_string support for. */ template struct string_traits; namespace internal { /// Throw exception for attempt to convert null to given type. [[noreturn]] PQXX_LIBEXPORT void throw_null_conversion( const std::string &type); /// Give a human-readable name for a type, at compile time. /** Each instantiation contains a static member called @c value which is the * type's name, as a string. * * This template should not be around for long. C++14's variable templates * make it easier (eliminating the cumbersome struct) and C++20's introspection * should obviate it completely. */ template struct type_name; #define PQXX_DECLARE_TYPE_NAME(TYPE) \ template<> struct type_name \ { static constexpr const char *value = #TYPE; } PQXX_DECLARE_TYPE_NAME(bool); PQXX_DECLARE_TYPE_NAME(short); PQXX_DECLARE_TYPE_NAME(unsigned short); PQXX_DECLARE_TYPE_NAME(int); PQXX_DECLARE_TYPE_NAME(unsigned int); PQXX_DECLARE_TYPE_NAME(long); PQXX_DECLARE_TYPE_NAME(unsigned long); PQXX_DECLARE_TYPE_NAME(long long); PQXX_DECLARE_TYPE_NAME(unsigned long long); PQXX_DECLARE_TYPE_NAME(float); PQXX_DECLARE_TYPE_NAME(double); PQXX_DECLARE_TYPE_NAME(long double); PQXX_DECLARE_TYPE_NAME(char *); PQXX_DECLARE_TYPE_NAME(const char *); PQXX_DECLARE_TYPE_NAME(std::string); PQXX_DECLARE_TYPE_NAME(const std::string); PQXX_DECLARE_TYPE_NAME(std::stringstream); #undef PQXX_DECLARE_TYPE_NAME template struct type_name { static constexpr const char *value = "char[]"; }; /// Helper: string traits implementation for built-in types. /** These types all look much alike, so they can share much of their traits * classes (though templatised, of course). * * The actual `to_string` and `from_string` are implemented in the library, * but the rest is defined inline. */ template struct PQXX_LIBEXPORT builtin_traits { static constexpr const char *name() noexcept { return internal::type_name::value; } static constexpr bool has_null() noexcept { return false; } static bool is_null(TYPE) { return false; } [[noreturn]] static TYPE null() { throw_null_conversion(name()); } static void from_string(const char Str[], TYPE &Obj); static std::string to_string(TYPE Obj); }; } // namespace pqxx::internal /// Helper: declare a string_traits specialisation for a builtin type. #define PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(TYPE) \ template<> struct PQXX_LIBEXPORT string_traits : \ internal::builtin_traits {}; PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(bool) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(short) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(unsigned short) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(int) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(unsigned int) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(long) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(unsigned long) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(long long) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(unsigned long long) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(float) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(double) PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION(long double) #undef PQXX_DECLARE_STRING_TRAITS_SPECIALIZATION /// Helper class for defining enum conversions. /** The conversion will convert enum values to numeric strings, and vice versa. * * To define a string conversion for an enum type, derive a @c string_traits * specialisation for the enum from this struct. * * There's usually an easier way though: the @c PQXX_DECLARE_ENUM_CONVERSION * macro. Use @c enum_traits manually only if you need to customise your * traits type in more detail, e.g. if your enum has a "null" value built in. */ template struct enum_traits { using underlying_type = typename std::underlying_type::type; using underlying_traits = string_traits; static constexpr bool has_null() noexcept { return false; } [[noreturn]] static ENUM null() { internal::throw_null_conversion("enum type"); } static void from_string(const char Str[], ENUM &Obj) { underlying_type tmp; underlying_traits::from_string(Str, tmp); Obj = ENUM(tmp); } static std::string to_string(ENUM Obj) { return underlying_traits::to_string(underlying_type(Obj)); } }; /// Macro: Define a string conversion for an enum type. /** This specialises the @c pqxx::string_traits template, so use it in the * @c ::pqxx namespace. * * For example: * * #include * #include * enum X { xa, xb }; * namespace pqxx { PQXX_DECLARE_ENUM_CONVERSION(x); } * int main() { std::cout << to_string(xa) << std::endl; } */ #define PQXX_DECLARE_ENUM_CONVERSION(ENUM) \ template<> \ struct string_traits : pqxx::enum_traits \ { \ static constexpr const char *name() noexcept { return #ENUM; } \ [[noreturn]] static ENUM null() \ { internal::throw_null_conversion(name()); } \ } /// String traits for C-style string ("pointer to const char") template<> struct PQXX_LIBEXPORT string_traits { static constexpr const char *name() noexcept { return "const char *"; } static constexpr bool has_null() noexcept { return true; } static bool is_null(const char *t) { return t == nullptr; } static const char *null() { return nullptr; } static void from_string(const char Str[], const char *&Obj) { Obj = Str; } static std::string to_string(const char *Obj) { return Obj; } }; /// String traits for non-const C-style string ("pointer to char") template<> struct PQXX_LIBEXPORT string_traits { static constexpr const char *name() noexcept { return "char *"; } static constexpr bool has_null() noexcept { return true; } static bool is_null(const char *t) { return t == nullptr; } static const char *null() { return nullptr; } // Don't allow this conversion since it breaks const-safety. // static void from_string(const char Str[], char *&Obj); static std::string to_string(char *Obj) { return Obj; } }; /// String traits for C-style string constant ("array of char") template struct PQXX_LIBEXPORT string_traits { static constexpr const char *name() noexcept { return "char[]"; } static constexpr bool has_null() noexcept { return true; } static bool is_null(const char t[]) { return t == nullptr; } static const char *null() { return nullptr; } static std::string to_string(const char Obj[]) { return Obj; } }; template<> struct PQXX_LIBEXPORT string_traits { static constexpr const char *name() noexcept { return "string"; } static constexpr bool has_null() noexcept { return false; } static bool is_null(const std::string &) { return false; } [[noreturn]] static std::string null() { internal::throw_null_conversion(name()); } static void from_string(const char Str[], std::string &Obj) { Obj=Str; } static std::string to_string(const std::string &Obj) { return Obj; } }; template<> struct PQXX_LIBEXPORT string_traits { static constexpr const char *name() noexcept { return "const string"; } static constexpr bool has_null() noexcept { return false; } static bool is_null(const std::string &) { return false; } [[noreturn]] static const std::string null() { internal::throw_null_conversion(name()); } static const std::string to_string(const std::string &Obj) { return Obj; } }; template<> struct PQXX_LIBEXPORT string_traits { static constexpr const char *name() noexcept { return "stringstream"; } static constexpr bool has_null() noexcept { return false; } static bool is_null(const std::stringstream &) { return false; } [[noreturn]] static std::stringstream null() { internal::throw_null_conversion(name()); } static void from_string(const char Str[], std::stringstream &Obj) { Obj.clear(); Obj << Str; } static std::string to_string(const std::stringstream &Obj) { return Obj.str(); } }; // TODO: Implement date conversions. /// Attempt to convert postgres-generated string to given built-in type /** If the form of the value found in the string does not match the expected * type, e.g. if a decimal point is found when converting to an integer type, * the conversion fails. Overflows (e.g. converting "9999999999" to a 16-bit * C++ type) are also treated as errors. If in some cases this behaviour should * be inappropriate, convert to something bigger such as @c long @c int first * and then truncate the resulting value. * * Only the simplest possible conversions are supported. No fancy features * such as hexadecimal or octal, spurious signs, or exponent notation will work. * No whitespace is stripped away. Only the kinds of strings that come out of * PostgreSQL and out of to_string() can be converted. */ template inline void from_string(const char Str[], T &Obj) { if (Str == nullptr) throw std::runtime_error{"Attempt to read null string."}; string_traits::from_string(Str, Obj); } /// Conversion with known string length (for strings that may contain nuls) /** This is only used for strings, where embedded nul bytes should not determine * the end of the string. * * For all other types, this just uses the regular, nul-terminated version of * from_string(). */ template inline void from_string(const char Str[], T &Obj, size_t) { return from_string(Str, Obj); } template<> inline void from_string( //[t00] const char Str[], std::string &Obj, size_t len) { if (Str == nullptr) throw std::runtime_error{"Attempt to read null string."}; Obj.assign(Str, len); } template inline void from_string(const std::string &Str, T &Obj) //[t45] { from_string(Str.c_str(), Obj); } template inline void from_string(const std::stringstream &Str, T &Obj) //[t00] { from_string(Str.str(), Obj); } template<> inline void from_string(const std::string &Str, std::string &Obj) //[t46] { Obj = Str; } namespace internal { /// Compute numeric value of given textual digit (assuming that it is a digit) constexpr int digit_to_number(char c) noexcept { return c-'0'; } constexpr char number_to_digit(int i) noexcept { return static_cast(i+'0'); } } // namespace pqxx::internal /// Convert built-in type to a readable string that PostgreSQL will understand /** No special formatting is done, and any locale settings are ignored. The * resulting string will be human-readable and in a format suitable for use in * SQL queries. */ template inline std::string to_string(const T &Obj) { return string_traits::to_string(Obj); } //@} } // namespace pqxx #endif libpqxx-6.4.5/include/pqxx/stream_base.hxx000066400000000000000000000031201350065432700206570ustar00rootroot00000000000000/** Definition of the pqxx::stream_base class. * * pqxx::stream_base provides optimized batch access to a database table. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/stream_base instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_STREAM_BASE #define PQXX_H_STREAM_BASE #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/transaction_base.hxx" #include "pqxx/util.hxx" #include namespace pqxx { class PQXX_LIBEXPORT PQXX_NOVTABLE stream_base : public internal::transactionfocus { public: explicit stream_base(transaction_base &); // TODO: Can we get rid of the vtable? virtual ~stream_base() noexcept =default; virtual void complete() = 0; operator bool() const noexcept; bool operator!() const noexcept; protected: bool m_finished; virtual void close(); template static std::string columnlist(const C &); template static std::string columnlist(I begin, I end); private: stream_base(); stream_base(const stream_base&); stream_base & operator=(const stream_base &); }; template std::string stream_base::columnlist(const C &c) { return columnlist(std::begin(c), std::end(c)); } template std::string stream_base::columnlist(I begin, I end) { return separated_list(",", begin, end); } } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/stream_from000066400000000000000000000003321350065432700201040ustar00rootroot00000000000000/** pqxx::stream_from class. * * pqxx::stream_from enables optimized batch reads from a database table. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/stream_from.hxx" libpqxx-6.4.5/include/pqxx/stream_from.hxx000066400000000000000000000112371350065432700207200ustar00rootroot00000000000000/** Definition of the pqxx::stream_from class. * * pqxx::stream_from enables optimized batch reads from a database table. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/stream_from instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_STREAM_FROM #define PQXX_H_STREAM_FROM #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/transaction_base.hxx" #include "pqxx/stream_base.hxx" #include "pqxx/internal/type_utils.hxx" #include namespace pqxx { /// Efficiently pull data directly out of a table. class PQXX_LIBEXPORT stream_from : public stream_base { public: stream_from( transaction_base &, const std::string &table_name ); template stream_from( transaction_base &, const std::string &table_name, const Columns& columns ); template stream_from( transaction_base &, const std::string &table_name, Iter columns_begin, Iter columns_end ); ~stream_from() noexcept; void complete() override; bool get_raw_line(std::string &); template stream_from & operator>>(Tuple &); private: internal::encoding_group m_copy_encoding; std::string m_current_line; bool m_retry_line; void set_up(transaction_base &, const std::string &table_name); void set_up( transaction_base &, const std::string &table_name, const std::string &columns ); void close() override; bool extract_field( const std::string &, std::string::size_type &, std::string & ) const; template auto tokenize_ith( const std::string &, Tuple &, std::string::size_type, std::string & ) const -> typename std::enable_if<( std::tuple_size::value > I )>::type; template auto tokenize_ith( const std::string &, Tuple &, std::string::size_type, std::string & ) const -> typename std::enable_if<( std::tuple_size::value <= I )>::type; template void extract_value( const std::string &line, T& t, std::string::size_type &here, std::string &workspace ) const; }; template stream_from::stream_from( transaction_base &tb, const std::string &table_name, const Columns& columns ) : stream_from{ tb, table_name, std::begin(columns), std::end(columns) } {} template stream_from::stream_from( transaction_base &tb, const std::string &table_name, Iter columns_begin, Iter columns_end ) : namedclass{"stream_from", table_name}, stream_base{tb} { set_up( tb, table_name, columnlist(columns_begin, columns_end) ); } template stream_from & stream_from::operator>>( Tuple &t ) { if (m_retry_line or get_raw_line(m_current_line)) { std::string workspace; try { tokenize_ith(m_current_line, t, 0, workspace); m_retry_line = false; } catch (...) { m_retry_line = true; throw; } } return *this; } template auto stream_from::tokenize_ith( const std::string &line, Tuple &t, std::string::size_type here, std::string &workspace ) const -> typename std::enable_if<( std::tuple_size::value > I )>::type { if (here >= line.size()) throw usage_error{"Too few fields to extract from stream_from line."}; extract_value(line, std::get(t), here, workspace); tokenize_ith(line, t, here, workspace); } template auto stream_from::tokenize_ith( const std::string &line, Tuple & /* t */, std::string::size_type here, std::string & /* workspace */ ) const -> typename std::enable_if<( std::tuple_size::value <= I )>::type { // Zero-column line may still have a trailing newline if ( here < line.size() and not (here == line.size() - 1 and line[here] == '\n')) throw usage_error{"Not all fields extracted from stream_from line"}; } template void stream_from::extract_value( const std::string &line, T& t, std::string::size_type &here, std::string &workspace ) const { if (extract_field(line, here, workspace)) from_string(workspace, t); else t = internal::null_value(); } template<> void stream_from::extract_value( const std::string &line, std::nullptr_t&, std::string::size_type &here, std::string &workspace ) const; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/stream_to000066400000000000000000000003241350065432700175640ustar00rootroot00000000000000/** pqxx::stream_to class. * * pqxx::stream_to enables optimized batch updates to a database table. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/stream_to.hxx" libpqxx-6.4.5/include/pqxx/stream_to.hxx000066400000000000000000000135561350065432700204050ustar00rootroot00000000000000/** Definition of the pqxx::stream_to class. * * pqxx::stream_to enables optimized batch updates to a database table. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/stream_to.hxx instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_STREAM_TO #define PQXX_H_STREAM_TO #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/transaction_base.hxx" #include "pqxx/stream_base.hxx" #include "pqxx/stream_from.hxx" #include "pqxx/internal/type_utils.hxx" #include namespace pqxx { /// Efficiently write data directly to a database table. /** If you wish to insert rows of data into a table, you can compose INSERT * statements and execute them. But it's slow and tedious, and you need to * worry about quoting and escaping the data. * * If you're just inserting a single row, it probably won't matter much. You * can use prepared or parameterised statements to take care of the escaping * for you. But if you're inserting large numbers of rows you will want * something better. * * Inserting rows one by one tends to take a lot of time, especially when you * are working with a remote database server over the network. Every single * row involves sending the data over the network, and waiting for a reply. * Do it "in bulk" using @c stream_to, and you may find that it goes many times * faster, sometimes even by orders of magnitude. * * Here's how it works: you create a @c stream_to stream to start writing to * your table. You will probably want to specify the columns. Then, you * feed your data into the stream one row at a time. And finally, you call the * stream's @c complete() to tell it to finalise the operation, wait for * completion, and check for errors. * * You insert data using the @c << ("shift-left") operator. Each row must be * something that can be iterated in order to get its constituent fields: a * @c std::tuple, a @c std::vector, or anything else with a @c begin and * @c end. It could be a class of your own. Of course the fields have to * match the columns you specified when creating the stream. * * There is also a matching stream_from for reading data in bulk. */ class PQXX_LIBEXPORT stream_to : public stream_base { public: /// Create a stream, without specifying columns. /** Fields will be inserted in whatever order the columns have in the * database. * * You'll probably want to specify the columns, so that the mapping between * your data fields and the table is explicit in your code, and not hidden * in an "implicit contract" between your code and your schema. */ stream_to(transaction_base &, const std::string &table_name); /// Create a stream, specifying column names as a container of strings. template stream_to( transaction_base &, const std::string &table_name, const Columns& columns ); /// Create a stream, specifying column names as a sequence of strings. template stream_to( transaction_base &, const std::string &table_name, Iter columns_begin, Iter columns_end ); ~stream_to() noexcept; /// Complete the operation, and check for errors. /** Always call this to close the stream in an orderly fashion, even after * an error. (In the case of an error, abort the transaction afterwards.) * * The only circumstance where it's safe to skip this is after an error, if * you're discarding the entire connection right away. */ void complete() override; /// Insert a row of data. /** The data can be any type that can be iterated. Each iterated item * becomes a field in the row, in the same order as the columns you * specified when creating the stream. * * Each field will be converted into the database's format using * @c pqxx::to_string. */ template stream_to & operator<<(const Tuple &); /// Stream a `stream_from` straight into a `stream_to`. /** This can be useful when copying between different databases. If the * source and the destination are on the same database, you'll get better * performance doing it all in a regular query. */ stream_to &operator<<(stream_from &); private: /// Write a row of data, as a line of text. void write_raw_line(const std::string &); void set_up(transaction_base &, const std::string &table_name); void set_up( transaction_base &, const std::string &table_name, const std::string &columns ); void close() override; }; template inline stream_to::stream_to( transaction_base &tb, const std::string &table_name, const Columns& columns ) : stream_to{ tb, table_name, std::begin(columns), std::end(columns) } {} template inline stream_to::stream_to( transaction_base &tb, const std::string &table_name, Iter columns_begin, Iter columns_end ) : namedclass{"stream_from", table_name}, stream_base{tb} { set_up( tb, table_name, columnlist(columns_begin, columns_end) ); } namespace internal { class PQXX_LIBEXPORT TypedCopyEscaper { static std::string escape(const std::string &); public: template std::string operator()(const T* t) const { return string_traits::is_null(*t) ? "\\N" : escape(to_string(*t)); } }; // Explicit specialization so we don't need a string_traits<> for nullptr_t template<> inline std::string TypedCopyEscaper::operator()( const std::nullptr_t* ) const { return "\\N"; } } // namespace pqxx::internal template stream_to & stream_to::operator<<(const Tuple &t) { write_raw_line(separated_list("\t", t, internal::TypedCopyEscaper())); return *this; } } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/subtransaction000066400000000000000000000003461350065432700206320ustar00rootroot00000000000000/** pqxx::subtransaction class. * * pqxx::subtransaction is a nested transaction, i.e. one inside a transaction. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/subtransaction.hxx" libpqxx-6.4.5/include/pqxx/subtransaction.hxx000066400000000000000000000061551350065432700214440ustar00rootroot00000000000000/** Definition of the pqxx::subtransaction class. * * pqxx::subtransaction is a nested transaction, i.e. one within a transaction. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/subtransaction instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_SUBTRANSACTION #define PQXX_H_SUBTRANSACTION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/dbtransaction.hxx" /* Methods tested in eg. self-test program test1 are marked with "//[t01]" */ namespace pqxx { /** * @ingroup transaction */ /// "Transaction" nested within another transaction /** A subtransaction can be executed inside a backend transaction, or inside * another subtransaction. This can be useful when, for example, statements in * a transaction may harmlessly fail and you don't want them to abort the entire * transaction. Here's an example of how a temporary table may be dropped * before re-creating it, without failing if the table did not exist: * * @code * void do_job(connection_base &C) * { * const string temptable = "fleetingtable"; * * // Since we're dealing with a temporary table here, disallow automatic * // recovery of the connection in case it breaks. * C.inhibit_reactivation(true); * * work W(C, "do_job"); * do_firstpart(W); * * // Attempt to delete our temporary table if it already existed * try * { * subtransaction S(W, "droptemp"); * S.exec0("DROP TABLE " + temptable); * S.commit(); * } * catch (const undefined_table &) * { * // Table did not exist. Which is what we were hoping to achieve anyway. * // Carry on without regrets. * } * * // S may have gone into a failed state and been destroyed, but the * // upper-level transaction W is still fine. We can continue to use it. * W.exec("CREATE TEMP TABLE " + temptable + "(bar integer, splat varchar)"); * * do_lastpart(W); * } * @endcode * * (This is just an example. If you really wanted to do drop a table without an * error if it doesn't exist, you'd use DROP TABLE IF EXISTS.) * * There are no isolation levels inside a transaction. They are not needed * because all actions within the same backend transaction are always performed * sequentially anyway. */ class PQXX_LIBEXPORT subtransaction : public internal::transactionfocus, public dbtransaction { public: /// Nest a subtransaction nested in another transaction. explicit subtransaction( //[t88] dbtransaction &T, const std::string &Name=std::string{}); /// Nest a subtransaction in another subtransaction. explicit subtransaction( subtransaction &T, const std::string &Name=std::string{}); virtual ~subtransaction() noexcept { End(); } private: virtual void do_begin() override; //[t88] virtual void do_commit() override; //[t88] virtual void do_abort() override; //[t88] dbtransaction &m_parent; }; } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/tablereader000066400000000000000000000003321350065432700200400ustar00rootroot00000000000000/** pqxx::tablereader class. * * pqxx::tablereader enables optimized batch reads from a database table. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/tablereader.hxx" libpqxx-6.4.5/include/pqxx/tablereader.hxx000066400000000000000000000060231350065432700206510ustar00rootroot00000000000000/** Definition of the pqxx::tablereader class. * * pqxx::tablereader enables optimized batch reads from a database table. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/tablereader instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_TABLEREADER #define PQXX_H_TABLEREADER #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/result.hxx" #include "pqxx/tablestream.hxx" namespace pqxx { /// @deprecated Use stream_from instead. /** Efficiently pull data directly out of a table. * @warning This class does not work reliably with multibyte encodings. Using * it with some multi-byte encodings may pose a security risk. */ class PQXX_LIBEXPORT tablereader : public tablestream { public: PQXX_DEPRECATED tablereader( transaction_base &, const std::string &Name, const std::string &Null=std::string{}); template PQXX_DEPRECATED tablereader( transaction_base &, const std::string &Name, ITER begincolumns, ITER endcolumns); template PQXX_DEPRECATED tablereader( transaction_base &, const std::string &Name, ITER begincolumns, ITER endcolumns, const std::string &Null); ~tablereader() noexcept; template tablereader &operator>>(TUPLE &); operator bool() const noexcept { return not m_done; } bool operator!() const noexcept { return m_done; } bool get_raw_line(std::string &Line); template void tokenize(std::string, TUPLE &) const; virtual void complete() override; private: void set_up( transaction_base &T, const std::string &RName, const std::string &Columns=std::string{}); PQXX_PRIVATE void reader_close(); std::string extract_field( const std::string &, std::string::size_type &) const; bool m_done; }; template inline tablereader::tablereader( transaction_base &T, const std::string &Name, ITER begincolumns, ITER endcolumns) : namedclass{Name, "tablereader"}, tablestream{T, std::string{}}, m_done{true} { set_up(T, Name, columnlist(begincolumns, endcolumns)); } template inline tablereader::tablereader( transaction_base &T, const std::string &Name, ITER begincolumns, ITER endcolumns, const std::string &Null) : namedclass{Name, "tablereader"}, tablestream{T, Null}, m_done{true} { set_up(T, Name, columnlist(begincolumns, endcolumns)); } template inline void tablereader::tokenize(std::string Line, TUPLE &T) const { std::back_insert_iterator ins = std::back_inserter(T); std::string::size_type here = 0; while (here < Line.size()) *ins++ = extract_field(Line, here); } template inline tablereader &pqxx::tablereader::operator>>(TUPLE &T) { std::string Line; if (get_raw_line(Line)) tokenize(Line, T); return *this; } } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/tablestream000066400000000000000000000003321350065432700200710ustar00rootroot00000000000000/** pqxx::tablestream class. * * pqxx::tablestream provides optimized batch access to a database table. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/tablestream.hxx" libpqxx-6.4.5/include/pqxx/tablestream.hxx000066400000000000000000000031541350065432700207040ustar00rootroot00000000000000/** Definition of the pqxx::tablestream class. * * pqxx::tablestream provides optimized batch access to a database table. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/tablestream instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_TABLESTREAM #define PQXX_H_TABLESTREAM #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/transaction_base.hxx" namespace pqxx { /// Base class for obsolete tablereader/tablewriter classes. /** @deprecated Use stream_from and stream_to instead. */ class PQXX_LIBEXPORT PQXX_NOVTABLE tablestream : public internal::transactionfocus { public: explicit tablestream( transaction_base &Trans, const std::string &Null=std::string{}); virtual ~tablestream() noexcept =0; virtual void complete() =0; protected: const std::string &NullStr() const { return m_null; } bool is_finished() const noexcept { return m_finished; } void base_close(); template static std::string columnlist(ITER colbegin, ITER colend); private: std::string m_null; bool m_finished = false; tablestream() =delete; tablestream(const tablestream &) =delete; tablestream &operator=(const tablestream &) =delete; }; template inline std::string tablestream::columnlist(ITER colbegin, ITER colend) { return separated_list(",", colbegin, colend); } } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/tablewriter000066400000000000000000000003321350065432700201120ustar00rootroot00000000000000/** pqxx::tablewriter class. * * pqxx::tablewriter enables optimized batch updates to a database table. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/tablewriter.hxx" libpqxx-6.4.5/include/pqxx/tablewriter.hxx000066400000000000000000000120551350065432700207250ustar00rootroot00000000000000/** Definition of the pqxx::tablewriter class. * * pqxx::tablewriter enables optimized batch updates to a database table. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/tablewriter.hxx instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_TABLEWRITER #define PQXX_H_TABLEWRITER #include #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/tablestream.hxx" namespace pqxx { /// @deprecated Use stream_to instead. /** Efficiently write data directly to a database table. * @warning This class does not work reliably with multibyte encodings. Using * it with some multi-byte encodings may pose a security risk. */ class PQXX_LIBEXPORT tablewriter : public tablestream { public: PQXX_DEPRECATED tablewriter( transaction_base &, const std::string &WName, const std::string &Null=std::string{}); template PQXX_DEPRECATED tablewriter( transaction_base &, const std::string &WName, ITER begincolumns, ITER endcolumns); template PQXX_DEPRECATED tablewriter( transaction_base &T, const std::string &WName, ITER begincolumns, ITER endcolumns, const std::string &Null); ~tablewriter() noexcept; template void insert(IT Begin, IT End); template void insert(const TUPLE &); template void push_back(IT Begin, IT End); template void push_back(const TUPLE &); template void reserve(SIZE) {} template tablewriter &operator<<(const TUPLE &); tablewriter &operator<<(tablereader &); template std::string generate(IT Begin, IT End) const; template std::string generate(const TUPLE &) const; virtual void complete() override; void write_raw_line(const std::string &); private: void set_up( transaction_base &, const std::string &WName, const std::string &Columns = std::string{}); PQXX_PRIVATE void writer_close(); }; } // namespace pqxx namespace std { template<> class back_insert_iterator { public: using iterator_category = output_iterator_tag; explicit back_insert_iterator(pqxx::tablewriter &W) noexcept : m_writer{&W} {} back_insert_iterator & operator=(const back_insert_iterator &rhs) noexcept { m_writer = rhs.m_writer; return *this; } template back_insert_iterator &operator=(const TUPLE &T) { m_writer->insert(T); return *this; } back_insert_iterator &operator++() { return *this; } back_insert_iterator &operator++(int) { return *this; } back_insert_iterator &operator*() { return *this; } private: pqxx::tablewriter *m_writer; }; } // namespace std namespace pqxx { template inline tablewriter::tablewriter( transaction_base &T, const std::string &WName, ITER begincolumns, ITER endcolumns) : namedclass{"tablewriter", WName}, tablestream{T, std::string{}} { set_up(T, WName, columnlist(begincolumns, endcolumns)); } template inline tablewriter::tablewriter( transaction_base &T, const std::string &WName, ITER begincolumns, ITER endcolumns, const std::string &Null) : namedclass{"tablewriter", WName}, tablestream{T, Null} { set_up(T, WName, columnlist(begincolumns, endcolumns)); } namespace internal { PQXX_LIBEXPORT std::string escape( const std::string &s, const std::string &null); inline std::string escape_any( const std::string &s, const std::string &null) { return escape(s, null); } inline std::string escape_any( const char s[], const std::string &null) { return s ? escape(std::string{s}, null) : "\\N"; } template inline std::string escape_any( const T &t, const std::string &null) { return escape(to_string(t), null); } template class Escaper { const std::string &m_null; public: explicit Escaper(const std::string &null) : m_null{null} {} std::string operator()(IT i) const { return escape_any(*i, m_null); } }; } template inline std::string tablewriter::generate(IT Begin, IT End) const { return separated_list("\t", Begin, End, internal::Escaper{NullStr()}); } template inline std::string tablewriter::generate(const TUPLE &T) const { return generate(std::begin(T), std::end(T)); } template inline void tablewriter::insert(IT Begin, IT End) { write_raw_line(generate(Begin, End)); } template inline void tablewriter::insert(const TUPLE &T) { insert(std::begin(T), std::end(T)); } template inline void tablewriter::push_back(IT Begin, IT End) { insert(Begin, End); } template inline void tablewriter::push_back(const TUPLE &T) { insert(std::begin(T), std::end(T)); } template inline tablewriter &tablewriter::operator<<(const TUPLE &T) { insert(T); return *this; } } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/transaction000066400000000000000000000003211350065432700201110ustar00rootroot00000000000000/** pqxx::transaction class. * * pqxx::transaction represents a standard database transaction. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/transaction.hxx" libpqxx-6.4.5/include/pqxx/transaction.hxx000066400000000000000000000057541350065432700207360ustar00rootroot00000000000000/** Definition of the pqxx::transaction class. * pqxx::transaction represents a standard database transaction. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/transaction instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_TRANSACTION #define PQXX_H_TRANSACTION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/dbtransaction.hxx" /* Methods tested in eg. self-test program test1 are marked with "//[t01]" */ namespace pqxx { namespace internal { /// Helper base class for the @c transaction class template. class PQXX_LIBEXPORT basic_transaction : public dbtransaction { protected: basic_transaction( //[t01] connection_base &C, const std::string &IsolationLevel, readwrite_policy); private: virtual void do_commit() override; //[t01] }; } // namespace internal /** * @ingroup transaction */ //@{ /// Standard back-end transaction, templatized on isolation level /** This is the type you'll normally want to use to represent a transaction on * the database. * * While you may choose to create your own transaction object to interface to * the database backend, it is recommended that you wrap your transaction code * into a transactor code instead and let the transaction be created for you. * @see pqxx/transactor.hxx * * If you should find that using a transactor makes your code less portable or * too complex, go ahead, create your own transaction anyway. * * Usage example: double all wages * * @code * extern connection C; * work T(C); * try * { * T.exec("UPDATE employees SET wage=wage*2"); * T.commit(); // NOTE: do this inside try block * } * catch (const exception &e) * { * cerr << e.what() << endl; * T.abort(); // Usually not needed; same happens when T's life ends. * } * @endcode */ template< isolation_level ISOLATIONLEVEL=read_committed, readwrite_policy READWRITE=read_write> class transaction : public internal::basic_transaction { public: using isolation_tag = isolation_traits; /// Create a transaction. /** * @param C Connection for this transaction to operate on * @param TName Optional name for transaction; must begin with a letter and * may contain letters and digits only */ explicit transaction(connection_base &C, const std::string &TName): //[t01] namedclass{fullname("transaction", isolation_tag::name()), TName}, internal::basic_transaction(C, isolation_tag::name(), READWRITE) { Begin(); } explicit transaction(connection_base &C) : //[t01] transaction(C, "") {} virtual ~transaction() noexcept { End(); } }; /// The default transaction type. using work = transaction<>; /// Read-only transaction. using read_transaction = transaction; //@} } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/transaction_base000066400000000000000000000004201350065432700211030ustar00rootroot00000000000000/** Base for the transaction classes. * * pqxx::transaction_base defines the interface for any abstract class that * represents a database transaction. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/transaction_base.hxx" libpqxx-6.4.5/include/pqxx/transaction_base.hxx000066400000000000000000000600761350065432700217260ustar00rootroot00000000000000/** Common code and definitions for the transaction classes. * * pqxx::transaction_base defines the interface for any abstract class that * represents a database transaction. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/transaction_base instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_TRANSACTION_BASE #define PQXX_H_TRANSACTION_BASE #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" /* End-user programs need not include this file, unless they define their own * transaction classes. This is not something the typical program should want * to do. * * However, reading this file is worthwhile because it defines the public * interface for the available transaction classes such as transaction and * nontransaction. */ #include "pqxx/connection_base.hxx" #include "pqxx/internal/encoding_group.hxx" #include "pqxx/isolation.hxx" #include "pqxx/result.hxx" #include "pqxx/row.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { namespace internal { class sql_cursor; class PQXX_LIBEXPORT transactionfocus : public virtual namedclass { public: explicit transactionfocus(transaction_base &t) : namedclass{"transactionfocus"}, m_trans{t}, m_registered{false} { } transactionfocus() =delete; transactionfocus(const transactionfocus &) =delete; transactionfocus &operator=(const transactionfocus &) =delete; protected: void register_me(); void unregister_me() noexcept; void reg_pending_error(const std::string &) noexcept; bool registered() const noexcept { return m_registered; } transaction_base &m_trans; private: bool m_registered; }; /// Helper class to construct an invocation of a parameterised statement. /** @deprecated Use @c exec_params and friends instead. */ class PQXX_LIBEXPORT parameterized_invocation : statement_parameters { public: PQXX_DEPRECATED parameterized_invocation( connection_base &, const std::string &query); parameterized_invocation &operator()() { add_param(); return *this; } parameterized_invocation &operator()(const binarystring &v) { add_binary_param(v, true); return *this; } template parameterized_invocation &operator()(const T &v) { add_param(v, true); return *this; } parameterized_invocation &operator()(const binarystring &v, bool nonnull) { add_binary_param(v, nonnull); return *this; } template parameterized_invocation &operator()(const T &v, bool nonnull) { add_param(v, nonnull); return *this; } result exec(); private: /// Not allowed parameterized_invocation &operator=(const parameterized_invocation &) =delete; connection_base &m_home; const std::string m_query; }; } // namespace internal namespace internal { namespace gate { class transaction_subtransaction; class transaction_tablereader; class transaction_sql_cursor; class transaction_stream_from; class transaction_tablewriter; class transaction_stream_to; class transaction_transactionfocus; } // namespace internal::gate } // namespace internal /** * @defgroup transaction Transaction classes * * All database access goes through instances of these classes. * However, not all implementations of this interface need to provide * full transactional integrity. * * Several implementations of this interface are shipped with libpqxx, including * the plain transaction class, the entirely unprotected nontransaction, and the * more cautious robusttransaction. */ /// Interface definition (and common code) for "transaction" classes. /** * @ingroup transaction * * Abstract base class for all transaction types. */ class PQXX_LIBEXPORT PQXX_NOVTABLE transaction_base : public virtual internal::namedclass { public: /// If nothing else is known, our isolation level is at least read_committed using isolation_tag = isolation_traits; transaction_base() =delete; transaction_base(const transaction_base &) =delete; transaction_base &operator=(const transaction_base &) =delete; virtual ~transaction_base() =0; //[t01] /// Commit the transaction /** Unless this function is called explicitly, the transaction will not be * committed (actually the nontransaction implementation breaks this rule, * hence the name). * * Once this function returns, the whole transaction will typically be * irrevocably completed in the database. There is also, however, a minute * risk that the connection to the database may be lost at just the wrong * moment. In that case, libpqxx may be unable to determine whether the * transaction was completed or aborted and an in_doubt_error will be thrown * to make this fact known to the caller. The robusttransaction * implementation takes some special precautions to reduce this risk. */ void commit(); //[t01] /// Abort the transaction /** No special effort is required to call this function; it will be called * implicitly when the transaction is destructed. */ void abort(); //[t10] /** * @ingroup escaping-functions */ //@{ /// Escape string for use as SQL string literal in this transaction std::string esc(const char str[]) const { return conn().esc(str); } /// Escape string for use as SQL string literal in this transaction std::string esc(const char str[], size_t maxlen) const { return conn().esc(str, maxlen); } /// Escape string for use as SQL string literal in this transaction std::string esc(const std::string &str) const { return conn().esc(str); } /// Escape binary data for use as SQL string literal in this transaction /** Raw, binary data is treated differently from regular strings. Binary * strings are never interpreted as text, so they may safely include byte * values or byte sequences that don't happen to represent valid characters in * the character encoding being used. * * The binary string does not stop at the first zero byte, as is the case with * textual strings. Instead, they may contain zero bytes anywhere. If it * happens to contain bytes that look like quote characters, or other things * that can disrupt their use in SQL queries, they will be replaced with * special escape sequences. */ std::string esc_raw(const unsigned char data[], size_t len) const //[t62] { return conn().esc_raw(data, len); } /// Escape binary data for use as SQL string literal in this transaction std::string esc_raw(const std::string &) const; //[t62] /// Unescape binary data, e.g. from a table field or notification payload. /** Takes a binary string as escaped by PostgreSQL, and returns a restored * copy of the original binary data. */ std::string unesc_raw(const std::string &text) const { return conn().unesc_raw(text); } /// Unescape binary data, e.g. from a table field or notification payload. /** Takes a binary string as escaped by PostgreSQL, and returns a restored * copy of the original binary data. */ std::string unesc_raw(const char *text) const { return conn().unesc_raw(text); } /// Represent object as SQL string, including quoting & escaping. /** Nulls are recognized and represented as SQL nulls. */ template std::string quote(const T &t) const { return conn().quote(t); } /// Binary-escape and quote a binarystring for use as an SQL constant. std::string quote_raw(const unsigned char str[], size_t len) const { return conn().quote_raw(str, len); } std::string quote_raw(const std::string &str) const; /// Escape an SQL identifier for use in a query. std::string quote_name(const std::string &identifier) const { return conn().quote_name(identifier); } /// Escape string for literal LIKE match. std::string esc_like(const std::string &str, char escape_char='\\') const { return conn().esc_like(str, escape_char); } //@} /// Execute query /** Perform a query in this transaction. * * This is one of the most important functions in libpqxx. * * Most libpqxx exceptions can be thrown from here, including sql_error, * broken_connection, and many sql_error subtypes such as * feature_not_supported or insufficient_privilege. But any exception thrown * by the C++ standard library may also occur here. All exceptions will be * derived from std::exception, however, and all libpqxx-specific exception * types are derived from pqxx::pqxx_exception. * * @param Query Query or command to execute * @param Desc Optional identifier for query, to help pinpoint SQL errors * @return A result set describing the query's or command's result */ result exec( const std::string &Query, const std::string &Desc=std::string{}); //[t01] result exec( const std::stringstream &Query, const std::string &Desc=std::string{}) { return exec(Query.str(), Desc); } /// Execute query, which should zero rows of data. /** Works like exec, but fails if the result contains data. It still returns * a result, however, which may contain useful metadata. * * @throw unexpected_rows If the query returned the wrong number of rows. */ result exec0( const std::string &Query, const std::string &Desc=std::string{}) { return exec_n(0, Query, Desc); } /// Execute query returning a single row of data. /** Works like exec, but requires the result to contain exactly one row. * The row can be addressed directly, without the need to find the first row * in a result set. * * @throw unexpected_rows If the query returned the wrong number of rows. */ row exec1(const std::string &Query, const std::string &Desc=std::string{}) { return exec_n(1, Query, Desc).front(); } /// Execute query, expect given number of rows. /** Works like exec, but checks that the number of rows is exactly what's * expected. * * @throw unexpected_rows If the query returned the wrong number of rows. */ result exec_n( size_t rows, const std::string &Query, const std::string &Desc=std::string{}); /** * @name Parameterized statements * * You'll often need parameters in the queries you execute: "select the * car with this licence plate." If the parameter is a string, you need to * quote it and escape any special characters inside it, or it may become a * target for an SQL injection attack. If it's an integer (for example), * you need to convert it to a string, but in the database's format, without * locale-specific niceties like "," separators between the thousands. * * Parameterised statements are an easier and safer way to do this. They're * like prepared statements, but for a single use. You don't need to name * them, and you don't need to prepare them first. * * Your query will include placeholders like @c $1 and $2 etc. in the places * where you want the arguments to go. Then, you pass the argument values * and the actual query is constructed for you. * * Pass the exact right number of parameters, and in the right order. The * parameters in the query don't have to be neatly ordered from @c $1 to * @c $2 to @c $3 - but you must pass the argument for @c $1 first, the one * for @c $2 second, etc. * * @warning Beware of "nul" bytes. Any string you pass as a parameter will * end at the first char with value zero. If you pass a @c std::string that * contains a zero byte, the last byte in the value will be the one just * before the zero. */ //@{ /// Execute an SQL statement with parameters. template result exec_params(const std::string &query, Args &&...args) { return internal_exec_params( query, internal::params(std::forward(args)...)); } // Execute parameterised statement, expect a single-row result. /** @throw unexpected_rows if the result does not consist of exactly one row. */ template row exec_params1(const std::string &query, Args&&... args) { return exec_params_n(1, query, std::forward(args)...).front(); } // Execute parameterised statement, expect a result with zero rows. /** @throw unexpected_rows if the result contains rows. */ template result exec_params0(const std::string &query, Args &&...args) { return exec_params_n(0, query, std::forward(args)...); } // Execute parameterised statement, expect exactly a given number of rows. /** @throw unexpected_rows if the result contains the wrong number of rows. */ template result exec_params_n(size_t rows, const std::string &query, Args &&...args) { const auto r = exec_params(query, std::forward(args)...); check_rowcount_params(rows, r.size()); return r; } /// Parameterize a statement. @deprecated Use @c exec_params instead. /* Use this to build up a parameterized statement invocation, then invoke it * using @c exec() * * Example: @c trans.parameterized("SELECT $1 + 1")(1).exec(); * * This is the old, pre-C++11 way of handling parameterised statements. As * of libpqxx 6.0, it's made much easier using variadic templates. */ PQXX_DEPRECATED internal::parameterized_invocation parameterized(const std::string &query); //@} /** * @name Prepared statements * * These are very similar to parameterised statements. The difference is * that you prepare them in advance, giving them identifying names. You can * then call them by these names, passing in the argument values appropriate * for that call. * * You prepare a statement on the connection, using * @c pqxx::connection_base::prepare(). But you then call the statement in a * transaction, using the functions you see here. * * Never try to prepare, execute, or unprepare a prepared statement manually * using direct SQL queries. Always use the functions provided by libpqxx. * * See \ref prepared for a full discussion. * * @warning Beware of "nul" bytes. Any string you pass as a parameter will * end at the first char with value zero. If you pass a @c std::string that * contains a zero byte, the last byte in the value will be the one just * before the zero. If you need a zero byte, consider using * pqxx::binarystring and/or SQL's @c bytea type. */ //@{ /// Execute a prepared statement, with optional arguments. template result exec_prepared(const std::string &statement, Args&&... args) { return internal_exec_prepared( statement, internal::params(std::forward(args)...)); } /// Execute a prepared statement, and expect a single-row result. /** @throw pqxx::unexpected_rows if the result was not exactly 1 row. */ template row exec_prepared1(const std::string &statement, Args&&... args) { return exec_prepared_n(1, statement, std::forward(args)...).front(); } /// Execute a prepared statement, and expect a result with zero rows. /** @throw pqxx::unexpected_rows if the result contained rows. */ template result exec_prepared0(const std::string &statement, Args&&... args) { return exec_prepared_n(0, statement, std::forward(args)...); } /// Execute a prepared statement, expect a result with given number of rows. /** @throw pqxx::unexpected_rows if the result did not contain exactly the * given number of rows. */ template result exec_prepared_n( size_t rows, const std::string &statement, Args&&... args) { const auto r = exec_prepared(statement, std::forward(args)...); check_rowcount_prepared(statement, rows, r.size()); return r; } /// Execute prepared statement. @deprecated Use exec_prepared instead. /** Just like param_declaration is a helper class that lets you tag parameter * declarations onto the statement declaration, the invocation class returned * here lets you tag parameter values onto the call: * * @code * result run_mystatement(transaction_base &T) * { * return T.exec_prepared("mystatement", "param1", 2, nullptr, 4); * } * @endcode * * Here, parameter 1 (written as "$1" in the statement's body) is a * string that receives the value "param1"; the second parameter is an integer * with the value 2; the third receives a null, making its type irrelevant; * and number 4 again is an integer. The ultimate invocation of exec() is * essential; if you forget this, nothing happens. * * To see whether any prepared statement has been defined under a given name, * use: * * @code * T.prepared("mystatement").exists() * @endcode * * @warning Do not try to execute a prepared statement manually through direct * SQL statements. This is likely not to work, and even if it does, is likely * to be slower than using the proper libpqxx functions. Also, libpqxx knows * how to emulate prepared statements if some part of the infrastructure does * not support them. * * @warning Actual definition of the prepared statement on the backend may be * deferred until its first use, which means that any errors in the prepared * statement may not show up until it is executed--and perhaps abort the * ongoing transaction in the process. * * If you leave out the statement name, the call refers to the nameless * statement instead. */ PQXX_DEPRECATED prepare::invocation prepared(const std::string &statement=std::string{}); //@} /** * @name Error/warning output */ //@{ /// Have connection process warning message void process_notice(const char Msg[]) const //[t14] { m_conn.process_notice(Msg); } /// Have connection process warning message void process_notice(const std::string &Msg) const //[t14] { m_conn.process_notice(Msg); } //@} /// Connection this transaction is running in connection_base &conn() const { return m_conn; } //[t04] /// Set session variable in this connection /** The new value is typically forgotten if the transaction aborts. * However nontransaction is an exception to this rule: in that case the set * value will be kept regardless. Also, if the connection ever needs to be * recovered, a value you set in a nontransaction will not be restored. * @param Var The variable to set * @param Val The new value to store in the variable */ void set_variable(const std::string &Var, const std::string &Val); //[t61] /// Get currently applicable value of variable /** First consults an internal cache of variables that have been set (whether * in the ongoing transaction or in the connection) using the set_variable * functions. If it is not found there, the database is queried. * * @warning Do not mix the set_variable with raw "SET" queries, and do not * try to set or get variables while a pipeline or table stream is active. * * @warning This function used to be declared as @c const but isn't anymore. */ std::string get_variable(const std::string &); //[t61] protected: /// Create a transaction (to be called by implementation classes only) /** The optional name, if nonempty, must begin with a letter and may contain * letters and digits only. * * @param c The connection that this transaction is to act on. * @param direct Running directly in connection context (i.e. not nested)? */ explicit transaction_base(connection_base &c, bool direct=true); /// Begin transaction (to be called by implementing class) /** Will typically be called from implementing class' constructor. */ void Begin(); /// End transaction. To be called by implementing class' destructor void End() noexcept; /// To be implemented by derived implementation class: start transaction virtual void do_begin() =0; /// To be implemented by derived implementation class: perform query virtual result do_exec(const char Query[]) =0; /// To be implemented by derived implementation class: commit transaction virtual void do_commit() =0; /// To be implemented by derived implementation class: abort transaction virtual void do_abort() =0; // For use by implementing class: /// Execute query on connection directly /** * @param C Query or command to execute * @param Retries Number of times to retry the query if it fails. Be * extremely careful with this option; if you retry in the middle of a * transaction, you may be setting up a new connection transparently and * executing the latter part of the transaction without a backend transaction * being active (and with the former part aborted). */ result direct_exec(const char C[], int Retries=0); /// Forget about any reactivation-blocking resources we tried to allocate void reactivation_avoidance_clear() noexcept {m_reactivation_avoidance.clear();} protected: /// Resources allocated in this transaction that make reactivation impossible /** This number may be negative! */ internal::reactivation_avoidance_counter m_reactivation_avoidance; private: /* A transaction goes through the following stages in its lifecycle: *
    *
  • nascent: the transaction hasn't actually begun yet. If our connection * fails at this stage, it may recover and the transaction can attempt to * establish itself again. *
  • active: the transaction has begun. Since no commit command has been * issued, abortion is implicit if the connection fails now. *
  • aborted: an abort has been issued; the transaction is terminated and * its changes to the database rolled back. It will accept no further * commands. *
  • committed: the transaction has completed successfully, meaning that a * commit has been issued. No further commands are accepted. *
  • in_doubt: the connection was lost at the exact wrong time, and there * is no way of telling whether the transaction was committed or aborted. *
* * Checking and maintaining state machine logic is the responsibility of the * base class (ie., this one). */ enum Status { st_nascent, st_active, st_aborted, st_committed, st_in_doubt }; /// Make sure transaction is opened on backend, if appropriate PQXX_PRIVATE void activate(); PQXX_PRIVATE void CheckPendingError(); template bool parm_is_null(T *p) const noexcept { return p == nullptr; } template bool parm_is_null(T) const noexcept { return false; } result internal_exec_prepared( const std::string &statement, const internal::params &args); result internal_exec_params( const std::string &query, const internal::params &args); /// Throw unexpected_rows if prepared statement returned wrong no. of rows. void check_rowcount_prepared( const std::string &statement, size_t expected_rows, size_t actual_rows); /// Throw unexpected_rows if wrong row count from parameterised statement. void check_rowcount_params( size_t expected_rows, size_t actual_rows); friend class pqxx::internal::gate::transaction_transactionfocus; PQXX_PRIVATE void register_focus(internal::transactionfocus *); PQXX_PRIVATE void unregister_focus(internal::transactionfocus *) noexcept; PQXX_PRIVATE void register_pending_error(const std::string &) noexcept; friend class pqxx::internal::gate::transaction_tablereader; friend class pqxx::internal::gate::transaction_stream_from; PQXX_PRIVATE void BeginCopyRead(const std::string &, const std::string &); bool read_copy_line(std::string &); friend class pqxx::internal::gate::transaction_tablewriter; friend class pqxx::internal::gate::transaction_stream_to; PQXX_PRIVATE void BeginCopyWrite( const std::string &Table, const std::string &Columns); void write_copy_line(const std::string &); void end_copy_write(); friend class pqxx::internal::gate::transaction_subtransaction; connection_base &m_conn; internal::unique m_focus; Status m_status = st_nascent; bool m_registered = false; std::map m_vars; std::string m_pending_error; }; } // namespace pqxx #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/transactor000066400000000000000000000003261350065432700177510ustar00rootroot00000000000000/** pqxx::transactor class. * * pqxx::transactor is a framework-style wrapper for safe transactions. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/transactor.hxx" libpqxx-6.4.5/include/pqxx/transactor.hxx000066400000000000000000000245211350065432700205620ustar00rootroot00000000000000/* Transactor framework, a wrapper for safely retryable transactions. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/transactor instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_TRANSACTOR #define PQXX_H_TRANSACTOR #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" #include "pqxx/connection_base.hxx" #include "pqxx/transaction.hxx" // Methods tested in eg. test module test01 are marked with "//[t01]". namespace pqxx { /** * @defgroup transactor Transactor framework * * Sometimes a transaction can fail for completely transient reasons, such as a * conflict with another transaction in SERIALIZABLE isolation. The right way * to handle those failures is often just to re-run the transaction from * scratch. * * For example, your REST API might be handling each HTTP request in its own * database transaction, and if this kind of transient failure happens, you * simply want to "replay" the whole request, in a fresh transaction. * * You won't necessarily want to execute the exact same SQL commands with the * exact same data. Some of your SQL statements may depend on state that can * vary between retries. So instead of dumbly replaying the SQL, you re-run * the same application code that produced those SQL commands. * * The transactor framework makes it a little easier for you to do this safely, * and avoid typical pitfalls. You encapsulate the work that you want to do * into a callable that you pass to the @c perform function. * * Here's how it works. You write your transaction code as a lambda or * function, which creates its own transaction object, does its work, and * commits at the end. You pass that callback to @c pqxx::perform, which runs * it for you. * * If there's a failure inside your callback, there will be an exception. Your * transaction object goes out of scope and gets destroyed, so that it aborts * implicitly. Seeing this, @c perform tries running your callback again. It * stops doing that when the callback succeeds, or when it has failed too many * times, or when there's an error that leaves the database in an unknown * state, such as a lost connection just while we're waiting for the database * to confirm a commit. It all depends on the type of exception. * * The callback takes no arguments. If you're using lambdas, the easy way to * pass arguments is for the lambda to "capture" them from your variables. Or, * if you're using functions, you may want to use @c std::bind. * * Once your callback succeeds, it can return a result, and @c perform will * return that result back to you. */ //@{ /// Simple way to execute a transaction with automatic retry. /** * Executes your transaction code as a callback. Repeats it until it completes * normally, or it throws an error other than the few libpqxx-generated * exceptions that the framework understands, or after a given number of failed * attempts, or if the transaction ends in an "in-doubt" state. * * (An in-doubt state is one where libpqxx cannot determine whether the server * finally committed a transaction or not. This can happen if the network * connection to the server is lost just while we're waiting for its reply to * a "commit" statement. The server may have completed the commit, or not, but * it can't tell you because there's no longer a connection. * * Using this still takes a bit of care. If your callback makes use of data * from the database, you'll probably have to query that data within your * callback. If the attempt to perform your callback fails, and the framework * tries again, you'll be in a new transaction and the data in the database may * have changed under your feet. * * Also be careful about changing variables or data structures from within * your callback. The run may still fail, and perhaps get run again. The * ideal way to do it (in most cases) is to return your result from your * callback, and change your program's data state only after @c perform * completes successfully. * * @param callback Transaction code that can be called with no arguments. * @param attempts Maximum number of times to attempt performing callback. * Must be greater than zero. * @return Whatever your callback returns. */ template inline auto perform(const TRANSACTION_CALLBACK &callback, int attempts=3) -> decltype(callback()) { if (attempts <= 0) throw std::invalid_argument{ "Zero or negative number of attempts passed to pqxx::perform()."}; for (; attempts > 0; --attempts) { try { return callback(); } catch (const in_doubt_error &) { // Not sure whether transaction went through or not. The last thing in // the world that we should do now is try again! throw; } catch (const statement_completion_unknown &) { // Not sure whether our last statement succeeded. Don't risk running it // again. throw; } catch (const broken_connection &) { // Connection failed. Definitely worth retrying. if (attempts <= 1) throw; continue; } catch (const transaction_rollback &) { // Some error that may well be transient, such as serialization failure // or deadlock. Worth retrying. if (attempts <= 1) throw; continue; } } throw pqxx::internal_error{"No outcome reached on perform()."}; } /// @deprecated Pre-C++11 wrapper for automatically retrying transactions. /** * Pass an object of your transactor-based class to connection_base::perform() * to execute the transaction code embedded in it. * * connection_base::perform() is actually a template, specializing itself to any * transactor type you pass to it. This means you will have to pass it a * reference of your object's ultimate static type; runtime polymorphism is * not allowed. Hence the absence of virtual methods in transactor. The * exact methods to be called at runtime *must* be resolved at compile time. * * Your transactor-derived class must define a copy constructor. This will be * used to create a "clean" copy of your transactor for every attempt that * perform() makes to run it. */ template> class transactor { public: using argument_type = TRANSACTION; PQXX_DEPRECATED explicit transactor( //[t04] const std::string &TName="transactor") : m_name{TName} { } /// Overridable transaction definition; insert your database code here /** The operation will be retried if the connection to the backend is lost or * the operation fails, but not if the connection is broken in such a way as * to leave the library in doubt as to whether the operation succeeded. In * that case, an in_doubt_error will be thrown. * * Recommended practice is to allow this operator to modify only the * transactor itself, and the dedicated transaction object it is passed as an * argument. This is what makes side effects, retrying etc. controllable in * the transactor framework. * @param T Dedicated transaction context created to perform this operation. */ void operator()(TRANSACTION &T); //[t04] // Overridable member functions, called by connection_base::perform() if an // attempt to run transaction fails/succeeds, respectively, or if the // connection is lost at just the wrong moment, goes into an indeterminate // state. Use these to patch up runtime state to match events, if needed, or // to report failure conditions. /// Optional overridable function to be called if transaction is aborted /** This need not imply complete failure; the transactor will automatically * retry the operation a number of times before giving up. on_abort() will be * called for each of the failed attempts. * * One parameter is passed in by the framework: an error string describing why * the transaction failed. This will also be logged to the connection's * notice processor. */ void on_abort(const char[]) noexcept {} //[t13] /// Optional overridable function to be called after successful commit /** If your on_commit() throws an exception, the actual back-end transaction * will remain committed, so any changes in the database remain regardless of * how this function terminates. */ void on_commit() {} //[t07] /// Overridable function to be called when "in doubt" about outcome /** This may happen if the connection to the backend is lost while attempting * to commit. In that case, the backend may have committed the transaction * but is unable to confirm this to the frontend; or the transaction may have * failed, causing it to be rolled back, but again without acknowledgement to * the client program. The best way to deal with this situation is typically * to wave red flags in the user's face and ask him to investigate. * * The robusttransaction class is intended to reduce the chances of this * error occurring, at a certain cost in performance. * @see robusttransaction */ void on_doubt() noexcept {} //[t13] /// The transactor's name. std::string name() const { return m_name; } //[t13] private: std::string m_name; }; template inline void connection_base::perform( const TRANSACTOR &T, int Attempts) { if (Attempts <= 0) return; bool Done = false; // Make attempts to perform T do { --Attempts; // Work on a copy of T2 so we can restore the starting situation if need be TRANSACTOR T2{T}; try { typename TRANSACTOR::argument_type X{*this, T2.name()}; T2(X); X.commit(); Done = true; } catch (const in_doubt_error &) { // Not sure whether transaction went through or not. The last thing in // the world that we should do now is retry. T2.on_doubt(); throw; } catch (const std::exception &e) { // Could be any kind of error. T2.on_abort(e.what()); if (Attempts <= 0) throw; continue; } catch (...) { // Don't try to forge ahead if we don't even know what happened T2.on_abort("Unknown exception"); throw; } T2.on_commit(); } while (not Done); } } // namespace pqxx //@} #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/types000066400000000000000000000002321350065432700167310ustar00rootroot00000000000000/** * Basic typedefs and forward declarations. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/types.hxx" libpqxx-6.4.5/include/pqxx/types.hxx000066400000000000000000000025731350065432700175510ustar00rootroot00000000000000/** * Basic type aliases and forward declarations. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this * mistake, or contact the author. */ #ifndef PQXX_H_TYPES #define PQXX_H_TYPES #include namespace pqxx { /// Number of rows in a result set. using result_size_type = unsigned long; /// Difference between result sizes. using result_difference_type = signed long; /// Number of fields in a row of database data. using row_size_type = unsigned int; /// Difference between row sizes. using row_difference_type = signed int; /// Number of bytes in a field of database data. using field_size_type = std::size_t; /// Number of bytes in a large object. (Unusual: it's signed.) using large_object_size_type = long; // Forward declarations, to help break compilation dependencies. // These won't necessarily include all classes in libpqxx. class binarystring; class connectionpolicy; class connection_base; class const_result_iterator; class const_reverse_result_iterator; class const_reverse_row_iterator; class const_row_iterator; class dbtransaction; class field; class largeobjectaccess; class notification_receiver; class range_error; class result; class row; class tablereader; class transaction_base; } // namespace pqxx #endif libpqxx-6.4.5/include/pqxx/util000066400000000000000000000002261350065432700165450ustar00rootroot00000000000000/** Various utility definitions for libpqxx. */ // Actual definitions in .hxx file so editors and such recognize file type #include "pqxx/util.hxx" libpqxx-6.4.5/include/pqxx/util.hxx000066400000000000000000000171501350065432700173570ustar00rootroot00000000000000/** Various utility definitions for libpqxx. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/util instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_UTIL #define PQXX_H_UTIL #include "pqxx/compiler-public.hxx" #include #include #include #include #include #include #include #include #include #include "pqxx/strconv.hxx" /// The home of all libpqxx classes, functions, templates, etc. namespace pqxx {} #include namespace pqxx { /// Suppress compiler warning about an unused item. template inline void ignore_unused(T) {} /// Descriptor of library's thread-safety model. /** This describes what the library knows about various risks to thread-safety. */ struct PQXX_LIBEXPORT thread_safety_model { /// @deprecated Is error reporting thread-safe? Now always true. bool have_safe_strerror = true; /// Is the underlying libpq build thread-safe? bool safe_libpq; /// @deprecated Query cancel is always thread-safe now. bool safe_query_cancel = true; /// @deprecated Always thread-safe to copy a 'result' or 'binarystring' now. bool safe_result_copy = true; /// Is Kerberos thread-safe? /** @warning Is currently always @c false. * * If your application uses Kerberos, all accesses to libpqxx or Kerberos must * be serialized. Confine their use to a single thread, or protect it with a * global lock. */ bool safe_kerberos; /// A human-readable description of any thread-safety issues. std::string description; }; /// Describe thread safety available in this build. PQXX_LIBEXPORT thread_safety_model describe_thread_safety() noexcept; /// The "null" oid. constexpr oid oid_none = 0; /** * @defgroup utility Utility functions */ //@{ /// Represent sequence of values as a string, joined by a given separator. /** * Use this to turn e.g. the numbers 1, 2, and 3 into a string "1, 2, 3". * * @param sep separator string (to be placed between items) * @param begin beginning of items sequence * @param end end of items sequence * @param access functor defining how to dereference sequence elements */ template inline std::string separated_list( //[t00] const std::string &sep, ITER begin, ITER end, ACCESS access) { std::string result; if (begin != end) { result = to_string(access(begin)); for (++begin; begin != end; ++begin) { result += sep; result += to_string(access(begin)); } } return result; } /// Render sequence as a string, using given separator between items. template inline std::string separated_list(const std::string &sep, ITER begin, ITER end) //[t00] { return separated_list(sep, begin, end, [](ITER i){ return *i; }); } /// Render items in a container as a string, using given separator. template inline auto separated_list(const std::string &sep, const CONTAINER &c) //[t10] /* Always std::string; necessary because SFINAE doesn't work with the contents of function bodies, so the check for iterability has to be in the signature. */ -> typename std::enable_if< ( not std::is_void::value and not std::is_void::value ), std::string >::type { return separated_list(sep, std::begin(c), std::end(c)); } /// Render items in a tuple as a string, using given separator. template< typename TUPLE, std::size_t INDEX=0, typename ACCESS, typename std::enable_if< (INDEX == std::tuple_size::value-1), int >::type=0 > inline std::string separated_list( const std::string & /* sep */, const TUPLE &t, const ACCESS& access ) { return to_string(access(&std::get(t))); } template< typename TUPLE, std::size_t INDEX=0, typename ACCESS, typename std::enable_if< (INDEX < std::tuple_size::value-1), int >::type=0 > inline std::string separated_list(const std::string &sep, const TUPLE &t, const ACCESS& access) { return to_string(access(&std::get(t))) + sep + separated_list(sep, t, access); } template< typename TUPLE, std::size_t INDEX=0, typename std::enable_if< (INDEX <= std::tuple_size::value), int >::type=0 > inline std::string separated_list(const std::string &sep, const TUPLE &t) { return separated_list(sep, t, [](const TUPLE &tup){return *tup;}); } //@} /// Private namespace for libpqxx's internal use; do not access. /** This namespace hides definitions internal to libpqxx. These are not * supposed to be used by client programs, and they may change at any time * without notice. * * Conversely, if you find something in this namespace tremendously useful, by * all means do lodge a request for its publication. * * @warning Here be dragons! */ namespace internal { PQXX_LIBEXPORT void freepqmem(const void *) noexcept; template inline void freepqmem_templated(P *p) noexcept { freepqmem(p); } PQXX_LIBEXPORT void freemallocmem(const void *) noexcept; template inline void freemallocmem_templated(P *p) noexcept { freemallocmem(p); } /// Helper base class: object descriptions for error messages and such. /** * Classes derived from namedclass have a class name (such as "transaction"), * an optional object name (such as "delete-old-logs"), and a description * generated from the two names (such as "transaction delete-old-logs"). * * The class name is dynamic here, in order to support inheritance hierarchies * where the exact class name may not be known statically. * * In inheritance hierarchies, make namedclass a virtual base class so that * each class in the hierarchy can specify its own class name in its * constructors. */ class PQXX_LIBEXPORT namedclass { public: explicit namedclass(const std::string &Classname) : m_classname{Classname}, m_name{} { } namedclass(const std::string &Classname, const std::string &Name) : m_classname{Classname}, m_name{Name} { } /// Object name, or the empty string if no name was given. const std::string &name() const noexcept { return m_name; } //[t01] /// Class name. const std::string &classname() const noexcept //[t73] { return m_classname; } /// Combination of class name and object name; or just class name. std::string description() const; private: std::string m_classname, m_name; }; PQXX_PRIVATE void CheckUniqueRegistration( const namedclass *New, const namedclass *Old); PQXX_PRIVATE void CheckUniqueUnregistration( const namedclass *New, const namedclass *Old); /// Ensure proper opening/closing of GUEST objects related to a "host" object /** Only a single GUEST may exist for a single host at any given time. GUEST * must be derived from namedclass. */ template class unique { public: unique() =default; unique(const unique &) =delete; unique &operator=(const unique &) =delete; GUEST *get() const noexcept { return m_guest; } void register_guest(GUEST *G) { CheckUniqueRegistration(G, m_guest); m_guest = G; } void unregister_guest(GUEST *G) { CheckUniqueUnregistration(G, m_guest); m_guest = nullptr; } private: GUEST *m_guest = nullptr; }; /// Sleep for the given number of seconds /** May return early, e.g. when interrupted by a signal. Completes instantly if * a zero or negative sleep time is requested. */ PQXX_LIBEXPORT void sleep_seconds(int); } // namespace internal } // namespace pqxx #endif libpqxx-6.4.5/include/pqxx/version000066400000000000000000000002061350065432700172530ustar00rootroot00000000000000/** libpqxx version info. */ // Actual definitions in .hxx file so editors and such recognize file type. #include "pqxx/version.hxx" libpqxx-6.4.5/include/pqxx/version.hxx000066400000000000000000000041171350065432700200660ustar00rootroot00000000000000/** Version info for libpqxx. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/version instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_VERSION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" /// Full libpqxx version string. #define PQXX_VERSION "6.4.4" /// Library ABI version. #define PQXX_ABI "6.4" /// Major version number. #define PQXX_VERSION_MAJOR 6 /// Minor version number. #define PQXX_VERSION_MINOR 4 namespace pqxx { namespace internal { /// Library version check stub. /** Helps detect version mismatches between libpqxx headers and the libpqxx * library binary. * * Sometimes users run into trouble linking their code against libpqxx because * they build their own libpqxx, but the system also has a different version * installed. The declarations in the headers against which they compile their * code will differ from the ones used to build the libpqxx version they're * using, leading to confusing link errors. The solution is to generate a link * error when the libpqxx binary is not the same version as the libpqxx headers * used to compile the code. * * This is a template declaration, but its only actual definition is a * sepcialisation for the current library version. The definition is in the * libpqxx binary, so it's based on the version as found in the binary. The * headers contain a call to the function, specialised on the libpqxx version * as found in the headers. (The library build process will use its own local * headers even if another version of the headers is installed on the system.) * * If the libpqxx binary was compiled for a different version than the user's * code, linking will fail with an error: @c check_library_version will not * exist for the given version number. */ template PQXX_LIBEXPORT int check_library_version() noexcept; } } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/include/pqxx/version.hxx.template000066400000000000000000000041641350065432700217020ustar00rootroot00000000000000/** Version info for libpqxx. * * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/version instead. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #ifndef PQXX_H_VERSION #include "pqxx/compiler-public.hxx" #include "pqxx/compiler-internal-pre.hxx" /// Full libpqxx version string. #define PQXX_VERSION "@PQXXVERSION@" /// Library ABI version. #define PQXX_ABI "@PQXX_ABI@" /// Major version number. #define PQXX_VERSION_MAJOR @PQXX_MAJOR@ /// Minor version number. #define PQXX_VERSION_MINOR @PQXX_MINOR@ namespace pqxx { namespace internal { /// Library version check stub. /** Helps detect version mismatches between libpqxx headers and the libpqxx * library binary. * * Sometimes users run into trouble linking their code against libpqxx because * they build their own libpqxx, but the system also has a different version * installed. The declarations in the headers against which they compile their * code will differ from the ones used to build the libpqxx version they're * using, leading to confusing link errors. The solution is to generate a link * error when the libpqxx binary is not the same version as the libpqxx headers * used to compile the code. * * This is a template declaration, but its only actual definition is a * sepcialisation for the current library version. The definition is in the * libpqxx binary, so it's based on the version as found in the binary. The * headers contain a call to the function, specialised on the libpqxx version * as found in the headers. (The library build process will use its own local * headers even if another version of the headers is installed on the system.) * * If the libpqxx binary was compiled for a different version than the user's * code, linking will fail with an error: @c check_library_version will not * exist for the given version number. */ template PQXX_LIBEXPORT int check_library_version() noexcept; } } #include "pqxx/compiler-internal-post.hxx" #endif libpqxx-6.4.5/libpqxx.pc.in000066400000000000000000000004401350065432700156400ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libpqxx Description: C++ client API for the PostgreSQL database management system. Version: @VERSION@ Libs: -L${libdir} -L@with_postgres_lib@ -lpqxx Cflags: -I${includedir} -I@with_postgres_include@ libpqxx-6.4.5/src/000077500000000000000000000000001350065432700140115ustar00rootroot00000000000000libpqxx-6.4.5/src/CMakeLists.txt000066400000000000000000000057061350065432700165610ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './src/CMakeLists.txt.template'. ################################################################################ if(NOT PostgreSQL_INCLUDE_DIRS) find_package(PostgreSQL REQUIRED) endif() # When setting up the include paths, mention the binary tree's include # directory *before* the source tree's include directory. If the source tree # happens to contain autoconf-generated config headers, we should still prefer # the ones in the binary tree. macro(library_target_setup tgt) target_include_directories(${tgt} PUBLIC $ $ $ PRIVATE ${PostgreSQL_INCLUDE_DIRS} ) target_link_libraries(${tgt} PRIVATE ${PostgreSQL_LIBRARIES}) if(WIN32) target_link_libraries(${tgt} PUBLIC wsock32 ws2_32) endif() install(TARGETS ${tgt} EXPORT libpqxx-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endmacro() # TODO: We're giving exact filenames here. Don't pretend they're globs. file( GLOB CXX_SOURCES array.cxx binarystring.cxx connection.cxx connection_base.cxx cursor.cxx dbtransaction.cxx encodings.cxx errorhandler.cxx except.cxx field.cxx largeobject.cxx nontransaction.cxx notification.cxx pipeline.cxx prepared_statement.cxx result.cxx robusttransaction.cxx row.cxx sql_cursor.cxx statement_parameters.cxx strconv.cxx stream_base.cxx stream_from.cxx stream_to.cxx subtransaction.cxx tablereader.cxx tablestream.cxx tablewriter.cxx transaction.cxx transaction_base.cxx util.cxx version.cxx ) if(NOT SKIP_PQXX_SHARED) set(CXX_SHARED_EXTRA_SOURCE) if(WIN32) # Add extra source list(APPEND CXX_SHARED_EXTRA_SOURCE "${PROJECT_SOURCE_DIR}/win32/libpqxx.cxx") endif() # Build a shared library add_library(pqxx_shared SHARED ${CXX_SOURCES} ${CXX_SHARED_EXTRA_SOURCE}) target_compile_definitions(pqxx_shared PUBLIC -DPQXX_SHARED) set_target_properties(pqxx_shared PROPERTIES OUTPUT_NAME pqxx) library_target_setup(pqxx_shared) endif() if(NOT SKIP_PQXX_STATIC) # Build a static libary add_library(pqxx_static STATIC ${CXX_SOURCES}) set_target_properties(pqxx_static PROPERTIES OUTPUT_NAME pqxx) library_target_setup(pqxx_static) endif() libpqxx-6.4.5/src/CMakeLists.txt.template000066400000000000000000000035551350065432700203730ustar00rootroot00000000000000if(NOT PostgreSQL_INCLUDE_DIRS) find_package(PostgreSQL REQUIRED) endif() # When setting up the include paths, mention the binary tree's include # directory *before* the source tree's include directory. If the source tree # happens to contain autoconf-generated config headers, we should still prefer # the ones in the binary tree. macro(library_target_setup tgt) target_include_directories(${tgt} PUBLIC $ $ $ PRIVATE ${PostgreSQL_INCLUDE_DIRS} ) target_link_libraries(${tgt} PRIVATE ${PostgreSQL_LIBRARIES}) if(WIN32) target_link_libraries(${tgt} PUBLIC wsock32 ws2_32) endif() install(TARGETS ${tgt} EXPORT libpqxx-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) endmacro() # TODO: We're giving exact filenames here. Don't pretend they're globs. file( GLOB CXX_SOURCES ###MAKTEMPLATE:FOREACH src/*.cxx ###BASENAME###.cxx ###MAKTEMPLATE:ENDFOREACH ) if(NOT SKIP_PQXX_SHARED) set(CXX_SHARED_EXTRA_SOURCE) if(WIN32) # Add extra source list(APPEND CXX_SHARED_EXTRA_SOURCE "${PROJECT_SOURCE_DIR}/win32/libpqxx.cxx") endif() # Build a shared library add_library(pqxx_shared SHARED ${CXX_SOURCES} ${CXX_SHARED_EXTRA_SOURCE}) target_compile_definitions(pqxx_shared PUBLIC -DPQXX_SHARED) set_target_properties(pqxx_shared PROPERTIES OUTPUT_NAME pqxx) library_target_setup(pqxx_shared) endif() if(NOT SKIP_PQXX_STATIC) # Build a static libary add_library(pqxx_static STATIC ${CXX_SOURCES}) set_target_properties(pqxx_static PROPERTIES OUTPUT_NAME pqxx) library_target_setup(pqxx_static) endif() libpqxx-6.4.5/src/Makefile.am000066400000000000000000000020371350065432700160470ustar00rootroot00000000000000lib_LTLIBRARIES = libpqxx.la libpqxx_la_SOURCES = \ array.cxx \ binarystring.cxx \ connection_base.cxx \ connection.cxx \ cursor.cxx \ dbtransaction.cxx \ encodings.cxx \ errorhandler.cxx \ except.cxx \ field.cxx \ largeobject.cxx \ nontransaction.cxx \ notification.cxx \ pipeline.cxx \ prepared_statement.cxx \ result.cxx \ robusttransaction.cxx \ sql_cursor.cxx \ statement_parameters.cxx \ strconv.cxx \ stream_base.cxx \ stream_from.cxx \ stream_to.cxx \ subtransaction.cxx \ tablereader.cxx \ tablestream.cxx \ tablewriter.cxx \ transaction.cxx \ transaction_base.cxx \ row.cxx \ util.cxx \ version.cxx libpqxx_version = -release $(PQXX_ABI) libpqxx_la_LDFLAGS = $(libpqxx_version) \ -rpath $(libdir) \ ${POSTGRES_LIB} AM_CPPFLAGS = \ -I$(top_srcdir)/include -I$(top_builddir)/include ${POSTGRES_INCLUDE} # Override automatically generated list of default includes. It contains only # unnecessary entries, and incorrectly mentions include/pqxx directly. DEFAULT_INCLUDES= MAINTAINERCLEANFILES=Makefile.in libpqxx-6.4.5/src/Makefile.in000066400000000000000000000600031350065432700160550ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libpqxx_la_LIBADD = am_libpqxx_la_OBJECTS = array.lo binarystring.lo connection_base.lo \ connection.lo cursor.lo dbtransaction.lo encodings.lo \ errorhandler.lo except.lo field.lo largeobject.lo \ nontransaction.lo notification.lo pipeline.lo \ prepared_statement.lo result.lo robusttransaction.lo \ sql_cursor.lo statement_parameters.lo strconv.lo \ stream_base.lo stream_from.lo stream_to.lo subtransaction.lo \ tablereader.lo tablestream.lo tablewriter.lo transaction.lo \ transaction_base.lo row.lo util.lo version.lo libpqxx_la_OBJECTS = $(am_libpqxx_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libpqxx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libpqxx_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libpqxx_la_SOURCES) DIST_SOURCES = $(libpqxx_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ lib_LTLIBRARIES = libpqxx.la libpqxx_la_SOURCES = \ array.cxx \ binarystring.cxx \ connection_base.cxx \ connection.cxx \ cursor.cxx \ dbtransaction.cxx \ encodings.cxx \ errorhandler.cxx \ except.cxx \ field.cxx \ largeobject.cxx \ nontransaction.cxx \ notification.cxx \ pipeline.cxx \ prepared_statement.cxx \ result.cxx \ robusttransaction.cxx \ sql_cursor.cxx \ statement_parameters.cxx \ strconv.cxx \ stream_base.cxx \ stream_from.cxx \ stream_to.cxx \ subtransaction.cxx \ tablereader.cxx \ tablestream.cxx \ tablewriter.cxx \ transaction.cxx \ transaction_base.cxx \ row.cxx \ util.cxx \ version.cxx libpqxx_version = -release $(PQXX_ABI) libpqxx_la_LDFLAGS = $(libpqxx_version) \ -rpath $(libdir) \ ${POSTGRES_LIB} AM_CPPFLAGS = \ -I$(top_srcdir)/include -I$(top_builddir)/include ${POSTGRES_INCLUDE} # Override automatically generated list of default includes. It contains only # unnecessary entries, and incorrectly mentions include/pqxx directly. DEFAULT_INCLUDES = MAINTAINERCLEANFILES = Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libpqxx.la: $(libpqxx_la_OBJECTS) $(libpqxx_la_DEPENDENCIES) $(EXTRA_libpqxx_la_DEPENDENCIES) $(AM_V_CXXLD)$(libpqxx_la_LINK) -rpath $(libdir) $(libpqxx_la_OBJECTS) $(libpqxx_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binarystring.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbtransaction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encodings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errorhandler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/except.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/field.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/largeobject.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nontransaction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notification.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipeline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prepared_statement.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/robusttransaction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/row.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sql_cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statement_parameters.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strconv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_from.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_to.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subtransaction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tablereader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tablestream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tablewriter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transaction.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transaction_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Plo@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/src/array.cxx000066400000000000000000000174001350065432700156550ustar00rootroot00000000000000/** Handling of SQL arrays. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include #include #include "pqxx/array" #include "pqxx/except" namespace pqxx { /// Scan to next glyph in the buffer. Assumes there is one. std::string::size_type array_parser::scan_glyph( std::string::size_type pos) const { assert(pos < m_end); return m_scan(m_input, m_end, pos); } /// Scan to next glyph in a substring. Assumes there is one. std::string::size_type array_parser::scan_glyph( std::string::size_type pos, std::string::size_type end) const { assert(pos < end); assert(end <= m_end); return m_scan(m_input, end, pos); } /// Find the end of a single-quoted SQL string in an SQL array. /** Returns the offset of the first character after the closing quote. */ std::string::size_type array_parser::scan_single_quoted_string() const { auto here = m_pos, next = scan_glyph(here); assert(next < m_end); assert(next - here == 1); assert(m_input[here] == '\''); for ( here = next, next = scan_glyph(here); here < m_end; here = next, next = scan_glyph(here) ) { if (next - here == 1) switch (m_input[here]) { case '\'': // SQL escapes single quotes by doubling them. Terrible idea, but it's // what we have. Inspect the next character to find out whether this is // the closing quote, or an escaped one inside the string. here = next; // (We can read beyond this quote because the array will always end in // a closing brace.) next = scan_glyph(here); if ((here + 1 < next) or (m_input[here] != '\'')) { // Our lookahead character is not an escaped quote. It's the first // character outside our string. So, return it. return here; } // We've just scanned an escaped quote. Keep going. break; case '\\': // Backslash escape. Skip ahead by one more character. here = next; next = scan_glyph(here); break; } } throw argument_error{"Null byte in SQL string: " + std::string{m_input}}; } /// Parse a single-quoted SQL string: un-quote it and un-escape it. std::string array_parser::parse_single_quoted_string( std::string::size_type end) const { // There have to be at least 2 characters: the opening and closing quotes. assert(m_pos + 1 < end); assert(m_input[m_pos] == '\''); assert(m_input[end - 1] == '\''); std::string output; // Maximum output size is same as the input size, minus the opening and // closing quotes. In the worst case, the real number could be half that. // Usually it'll be a pretty close estimate. output.reserve(end - m_pos - 2); for ( auto here = m_pos + 1, next = scan_glyph(here, end); here < end - 1; here = next, next = scan_glyph(here, end) ) { if ( next - here == 1 and (m_input[here] == '\'' or m_input[here] == '\\') ) { // Skip escape. here = next; next = scan_glyph(here, end); } output.append(m_input + here, m_input + next); } return output; } /// Find the end of a double-quoted SQL string in an SQL array. std::string::size_type array_parser::scan_double_quoted_string() const { auto here = m_pos; assert(here < m_end); auto next = scan_glyph(here); assert(next - here == 1); assert(m_input[here] == '"'); for ( here = next, next = scan_glyph(here); here < m_end; here = next, next = scan_glyph(here) ) { if (next - here == 1) switch (m_input[here]) { case '\\': // Backslash escape. Skip ahead by one more character. here = next; next = scan_glyph(here); break; case '"': // Closing quote. Return the position right after. return next; } } throw argument_error{"Null byte in SQL string: " + std::string{m_input}}; } /// Parse a double-quoted SQL string: un-quote it and un-escape it. std::string array_parser::parse_double_quoted_string( std::string::size_type end) const { // There have to be at least 2 characters: the opening and closing quotes. assert(m_pos + 1 < end); assert(m_input[m_pos] == '"'); assert(m_input[end - 1] == '"'); std::string output; // Maximum output size is same as the input size, minus the opening and // closing quotes. In the worst case, the real number could be half that. // Usually it'll be a pretty close estimate. output.reserve(std::size_t(end - m_pos - 2)); for ( auto here = scan_glyph(m_pos, end), next = scan_glyph(here, end); here < end - 1; here = next, next = scan_glyph(here, end) ) { if ((next - here == 1) and (m_input[here] == '\\')) { // Skip escape. here = next; next = scan_glyph(here, end); } output.append(m_input + here, m_input + next); } return output; } /// Find the end of an unquoted string in an SQL array. /** Assumes UTF-8 or an ASCII-superset single-byte encoding. */ std::string::size_type array_parser::scan_unquoted_string() const { auto here = m_pos, next = scan_glyph(here); assert(here < m_end); assert((next - here > 1) or (m_input[here] != '\'')); assert((next - here > 1) or (m_input[here] != '"')); while ( (next - here) > 1 or ( m_input[here] != ',' and m_input[here] != ';' and m_input[here] != '}' ) ) { here = next; next = scan_glyph(here); } return here; } /// Parse an unquoted SQL string. /** Here, the special unquoted value NULL means a null value, not a string * that happens to spell "NULL". */ std::string array_parser::parse_unquoted_string( std::string::size_type end) const { return std::string{m_input + m_pos, m_input + end}; } array_parser::array_parser( const char input[], internal::encoding_group enc) : m_input(input), m_end(input == nullptr ? 0 : std::strlen(input)), m_scan(internal::get_glyph_scanner(enc)), m_pos(0) { } std::pair array_parser::get_next() { juncture found; std::string value; std::string::size_type end; if (m_input == nullptr or (m_pos >= m_end)) return std::make_pair(juncture::done, value); if (scan_glyph(m_pos) - m_pos > 1) { // Non-ASCII unquoted string. end = scan_unquoted_string(); value = parse_unquoted_string(end); found = juncture::string_value; } else switch (m_input[m_pos]) { case '\0': // TODO: Maybe just raise an error? found = juncture::done; end = m_pos; break; case '{': found = juncture::row_start; end = scan_glyph(m_pos); break; case '}': found = juncture::row_end; end = scan_glyph(m_pos); break; case '\'': found = juncture::string_value; end = scan_single_quoted_string(); value = parse_single_quoted_string(end); break; case '"': found = juncture::string_value; end = scan_double_quoted_string(); value = parse_double_quoted_string(end); break; default: end = scan_unquoted_string(); value = parse_unquoted_string(end); if (value == "NULL") { // In this one situation, as a special case, NULL means a null field, // not a string that happens to spell "NULL". value.clear(); found = juncture::null_value; } else { // The normal case: we just parsed an unquoted string. The value is // what we need. found = juncture::string_value; } break; } // Skip a trailing field separator, if present. if (end < m_end) { auto next = scan_glyph(end); if (next - end == 1 and (m_input[end] == ',' or m_input[end] == ';')) end = next; } m_pos = end; return std::make_pair(found, value); } } // namespace pqxx libpqxx-6.4.5/src/binarystring.cxx000066400000000000000000000070341350065432700172540ustar00rootroot00000000000000/** Implementation of bytea (binary string) conversions. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include #include #include extern "C" { #include "libpq-fe.h" } #include "pqxx/binarystring" #include "pqxx/field" using namespace pqxx::internal; namespace { using unsigned_char = unsigned char; using buffer = std::pair; buffer to_buffer(const void *data, size_t len) { void *const output{malloc(len + 1)}; if (output == nullptr) throw std::bad_alloc{}; static_cast(output)[len] = '\0'; memcpy(static_cast(output), data, len); return buffer{static_cast(output), len}; } buffer to_buffer(const std::string &source) { return to_buffer(source.c_str(), source.size()); } buffer unescape(const unsigned char escaped[]) { #ifdef _WIN32 /* On Windows only, the return value from PQunescapeBytea() must be freed * using PQfreemem. Copy to a buffer allocated by libpqxx, so that the * binarystring's buffer can be freed uniformly, */ size_t unescaped_len = 0; // TODO: Use make_unique once we require C++14. Sooo much easier. std::unique_ptr A( PQunescapeBytea(const_cast(escaped), &unescaped_len), freepqmem_templated); void *data = A.get(); if (data == nullptr) throw std::bad_alloc{}; return to_buffer(data, unescaped_len); #else /* On non-Windows platforms, it's okay to free libpq-allocated memory using * free(). No extra copy needed. */ buffer unescaped; unescaped.first = PQunescapeBytea( const_cast(escaped), &unescaped.second); if (unescaped.first == nullptr) throw std::bad_alloc{}; return unescaped; #endif } } // namespace pqxx::binarystring::binarystring(const field &F) : m_buf{make_smart_pointer()}, m_size{0} { buffer unescaped{unescape(reinterpret_cast(F.c_str()))}; m_buf = make_smart_pointer(unescaped.first); m_size = unescaped.second; } pqxx::binarystring::binarystring(const std::string &s) : m_buf{make_smart_pointer()}, m_size{s.size()} { m_buf = make_smart_pointer(to_buffer(s).first); } pqxx::binarystring::binarystring(const void *binary_data, size_t len) : m_buf{make_smart_pointer()}, m_size{len} { m_buf = make_smart_pointer(to_buffer(binary_data, len).first); } bool pqxx::binarystring::operator==(const binarystring &rhs) const noexcept { if (rhs.size() != size()) return false; return std::memcmp(data(), rhs.data(), size()) == 0; } pqxx::binarystring &pqxx::binarystring::operator=(const binarystring &rhs) { m_buf = rhs.m_buf; m_size = rhs.m_size; return *this; } pqxx::binarystring::const_reference pqxx::binarystring::at(size_type n) const { if (n >= m_size) { if (m_size == 0) throw std::out_of_range{"Accessing empty binarystring"}; throw std::out_of_range{ "binarystring index out of range: " + to_string(n) + " (should be below " + to_string(m_size) + ")"}; } return data()[n]; } void pqxx::binarystring::swap(binarystring &rhs) { m_buf.swap(rhs.m_buf); // This part very obviously can't go wrong, so do it last const auto s = m_size; m_size = rhs.m_size; rhs.m_size = s; } std::string pqxx::binarystring::str() const { return std::string{get(), m_size}; } libpqxx-6.4.5/src/connection.cxx000066400000000000000000000074031350065432700167000ustar00rootroot00000000000000/** Implementation of the pqxx::connection and sibling classes. * * Different ways of setting up a backend connection. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include extern "C" { #include "libpq-fe.h" } #include "pqxx/connection" pqxx::connectionpolicy::connectionpolicy(const std::string &opts) : m_options{opts} { } pqxx::connectionpolicy::~connectionpolicy() noexcept { } pqxx::connectionpolicy::handle pqxx::connectionpolicy::normalconnect(handle orig) { if (orig) return orig; orig = PQconnectdb(options().c_str()); if (orig == nullptr) throw std::bad_alloc{}; if (PQstatus(orig) != CONNECTION_OK) { const std::string msg{PQerrorMessage(orig)}; PQfinish(orig); throw broken_connection{msg}; } return orig; } pqxx::connectionpolicy::handle pqxx::connectionpolicy::do_startconnect(handle orig) { return orig; } pqxx::connectionpolicy::handle pqxx::connectionpolicy::do_completeconnect(handle orig) { return orig; } pqxx::connectionpolicy::handle pqxx::connectionpolicy::do_dropconnect(handle orig) noexcept { return orig; } pqxx::connectionpolicy::handle pqxx::connectionpolicy::do_disconnect(handle orig) noexcept { orig = do_dropconnect(orig); if (orig) PQfinish(orig); return nullptr; } bool pqxx::connectionpolicy::is_ready(handle h) const noexcept { return h != nullptr; } pqxx::connectionpolicy::handle pqxx::connect_direct::do_startconnect(handle orig) { if (orig) return orig; orig = normalconnect(orig); if (PQstatus(orig) != CONNECTION_OK) { const std::string msg{PQerrorMessage(orig)}; do_disconnect(orig); throw broken_connection{msg}; } return orig; } pqxx::connectionpolicy::handle pqxx::connect_lazy::do_completeconnect(handle orig) { return normalconnect(orig); } pqxx::connect_async::connect_async(const std::string &opts) : connectionpolicy{opts}, m_connecting{false} { } pqxx::connectionpolicy::handle pqxx::connect_async::do_startconnect(handle orig) { if (orig != nullptr) return orig; // Already connecting or connected. m_connecting = false; orig = PQconnectStart(options().c_str()); if (orig == nullptr) throw std::bad_alloc{}; if (PQstatus(orig) == CONNECTION_BAD) { do_dropconnect(orig); throw broken_connection{std::string{PQerrorMessage(orig)}}; } m_connecting = true; return orig; } pqxx::connectionpolicy::handle pqxx::connect_async::do_completeconnect(handle orig) { const bool makenew = (orig == nullptr); if (makenew) orig = do_startconnect(orig); if (not m_connecting) return orig; // Our "attempt to connect" state ends here, for better or for worse m_connecting = false; PostgresPollingStatusType pollstatus = PGRES_POLLING_WRITING; do { switch (pollstatus) { case PGRES_POLLING_FAILED: if (makenew) do_disconnect(orig); throw broken_connection{std::string{PQerrorMessage(orig)}}; case PGRES_POLLING_READING: internal::wait_read(orig); break; case PGRES_POLLING_WRITING: internal::wait_write(orig); break; case PGRES_POLLING_OK: break; default: // Meaningless, really, but deals with the obsolete PGRES_POLLING_ACTIVE // without requiring it to be defined. break; } pollstatus = PQconnectPoll(orig); } while (pollstatus != PGRES_POLLING_OK); return orig; } pqxx::connectionpolicy::handle pqxx::connect_async::do_dropconnect(handle orig) noexcept { m_connecting = false; return orig; } bool pqxx::connect_async::is_ready(handle h) const noexcept { return h != nullptr and not m_connecting; } libpqxx-6.4.5/src/connection_base.cxx000066400000000000000000001046751350065432700177030ustar00rootroot00000000000000/** Implementation of the pqxx::connection_base abstract base class. * * pqxx::connection_base encapsulates a frontend to backend connection. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include #include #include #include #include #include #include #include #if defined(_WIN32) // Includes for WSAPoll(). #include #include #include #elif defined(HAVE_POLL) // Include for poll(). #include #elif defined(HAVE_SYS_SELECT_H) // Include for select() on (recent) POSIX systems. #include #else // Includes for select() according to various older standards. #if defined(HAVE_SYS_TYPES_H) #include #endif #if defined(HAVE_UNISTD_H) #include #endif #endif #if defined(HAVE_SYS_TIME_H) #include #endif extern "C" { #include "libpq-fe.h" } #include "pqxx/binarystring" #include "pqxx/connection" #include "pqxx/connection_base" #include "pqxx/nontransaction" #include "pqxx/pipeline" #include "pqxx/result" #include "pqxx/strconv" #include "pqxx/transaction" #include "pqxx/notification" #include "pqxx/internal/gates/connection-reactivation_avoidance_exemption.hxx" #include "pqxx/internal/gates/errorhandler-connection.hxx" #include "pqxx/internal/gates/result-creation.hxx" #include "pqxx/internal/gates/result-connection.hxx" using namespace pqxx; using namespace pqxx::internal; using namespace pqxx::prepare; extern "C" { // The PQnoticeProcessor that receives an error or warning from libpq and sends // it to the appropriate connection for processing. void pqxx_notice_processor(void *conn, const char *msg) noexcept { reinterpret_cast(conn)->process_notice(msg); } // There's no way in libpq to disable a connection's notice processor. So, // set an inert one to get the same effect. void inert_notice_processor(void *, const char *) noexcept {} } std::string pqxx::encrypt_password( const std::string &user, const std::string &password) { std::unique_ptr p{ PQencryptPassword(password.c_str(), user.c_str()), freepqmem_templated}; return std::string{p.get()}; } void pqxx::connection_base::init() { m_conn = m_policy.do_startconnect(m_conn); #include "pqxx/internal/ignore-deprecated-pre.hxx" if (m_policy.is_ready(m_conn)) activate(); #include "pqxx/internal/ignore-deprecated-post.hxx" } pqxx::result pqxx::connection_base::make_result( internal::pq::PGresult *rhs, const std::string &query) { return gate::result_creation::create( rhs, query, internal::enc_group(encoding_id())); } int pqxx::connection_base::backendpid() const noexcept { return m_conn ? PQbackendPID(m_conn) : 0; } namespace { PQXX_PURE int socket_of(const ::pqxx::internal::pq::PGconn *c) noexcept { return c ? PQsocket(c) : -1; } } int pqxx::connection_base::sock() const noexcept { return socket_of(m_conn); } void pqxx::connection_base::activate() { if (not is_open()) { if (m_inhibit_reactivation) throw broken_connection{ "Could not reactivate connection; " "reactivation is inhibited"}; // If any objects were open that didn't survive the closing of our // connection, don't try to reactivate if (m_reactivation_avoidance.get()) return; try { m_conn = m_policy.do_startconnect(m_conn); m_conn = m_policy.do_completeconnect(m_conn); m_completed = true; // (But retracted if error is thrown below) if (not is_open()) throw broken_connection{}; set_up_state(); } catch (const broken_connection &e) { disconnect(); m_completed = false; throw broken_connection{e.what()}; } catch (const std::exception &) { m_completed = false; throw; } } } void pqxx::connection_base::deactivate() { if (m_conn == nullptr) return; if (m_trans.get()) throw usage_error{ "Attempt to deactivate connection while " + m_trans.get()->description() + " still open"}; if (m_reactivation_avoidance.get()) { process_notice( "Attempt to deactivate connection while it is in a state " "that cannot be fully recovered later (ignoring)"); return; } m_completed = false; m_conn = m_policy.do_disconnect(m_conn); } void pqxx::connection_base::simulate_failure() { if (m_conn) { m_conn = m_policy.do_disconnect(m_conn); #include inhibit_reactivation(true); #include } } int pqxx::connection_base::protocol_version() const noexcept { return m_conn ? PQprotocolVersion(m_conn) : 0; } int pqxx::connection_base::server_version() const noexcept { return m_serverversion; } void pqxx::connection_base::set_variable(const std::string &Var, const std::string &Value) { if (m_trans.get()) { // We're in a transaction. The variable should go in there. m_trans.get()->set_variable(Var, Value); } else { // We're not in a transaction. Set a session variable. if (is_open()) raw_set_var(Var, Value); m_vars[Var] = Value; } } std::string pqxx::connection_base::get_variable(const std::string &Var) { return m_trans.get() ? m_trans.get()->get_variable(Var) : raw_get_var(Var); } std::string pqxx::connection_base::raw_get_var(const std::string &Var) { // Is this variable in our local map of set variables? const auto i = m_vars.find(Var); if (i != m_vars.end()) return i->second; return exec(("SHOW " + Var).c_str(), 0).at(0).at(0).as(std::string{}); } void pqxx::connection_base::clearcaps() noexcept { m_caps.reset(); } /** Set up various parts of logical connection state that may need to be * recovered because the physical connection to the database was lost and is * being reset, or that may not have been initialized yet. */ void pqxx::connection_base::set_up_state() { if (m_conn == nullptr) throw internal_error{"set_up_state() on no connection"}; if (status() != CONNECTION_OK) { const auto msg = err_msg(); m_conn = m_policy.do_disconnect(m_conn); throw failure{msg}; } read_capabilities(); for (auto &p: m_prepared) p.second.registered = false; // The default notice processor in libpq writes to stderr. Ours does // nothing. // If the caller registers an error handler, this gets replaced with an // error handler that walks down the connection's chain of handlers. We // don't do that by default because there's a danger: libpq may call the // notice processor via a result object, even after the connection has been // destroyed and the handlers list no longer exists. clear_notice_processor(); internal_set_trace(); if (not m_receivers.empty() or not m_vars.empty()) { std::stringstream restore_query; // Pipeline all queries needed to restore receivers and variables, so we can // send them over in one go. // Reinstate all active receivers if (not m_receivers.empty()) { std::string Last; for (auto &i: m_receivers) { // m_receivers can handle multiple receivers waiting on the same event; // issue just one LISTEN for each event. if (i.first != Last) { restore_query << "LISTEN " << quote_name(i.first) << "; "; Last = i.first; } } } for (auto &i: m_vars) restore_query << "SET " << i.first << "=" << i.second << "; "; // Now do the whole batch at once PQsendQuery(m_conn, restore_query.str().c_str()); result r; do r = make_result(PQgetResult(m_conn), "[RECONNECT]"); while (gate::result_connection(r)); } m_completed = true; if (not is_open()) throw broken_connection{}; } void pqxx::connection_base::check_result(const result &R) { if (not is_open()) throw broken_connection{}; // A shame we can't quite detect out-of-memory to turn this into a bad_alloc! if (not gate::result_connection{R}) throw failure(err_msg()); gate::result_creation{R}.check_status(); } void pqxx::connection_base::disconnect() noexcept { // When we activate again, the server may be different! clearcaps(); m_conn = m_policy.do_disconnect(m_conn); } bool pqxx::connection_base::is_open() const noexcept { return m_conn and m_completed and (status() == CONNECTION_OK); } void pqxx::connection_base::process_notice_raw(const char msg[]) noexcept { if ((msg == nullptr) or (*msg == '\0')) return; const auto rbegin = m_errorhandlers.crbegin(), rend = m_errorhandlers.crend(); for (auto i = rbegin; (i != rend) and (**i)(msg); ++i) ; } void pqxx::connection_base::process_notice(const char msg[]) noexcept { if (msg == nullptr) return; const auto len = strlen(msg); if (len == 0) return; if (msg[len-1] == '\n') { process_notice_raw(msg); } else try { // Newline is missing. Try the C++ string version of this function. process_notice(std::string{msg}); } catch (const std::exception &) { // If we can't even do that, use plain old buffer copying instead // (unavoidably, this will break up overly long messages!) const char separator[] = "[...]\n"; char buf[1007]; size_t bytes = sizeof(buf)-sizeof(separator)-1; size_t written; strcpy(&buf[bytes], separator); // Write all chunks but last. Each will fill the buffer exactly. for (written = 0; (written+bytes) < len; written += bytes) { memcpy(buf, &msg[written], bytes); process_notice_raw(buf); } // Write any remaining bytes (which won't fill an entire buffer) bytes = len-written; memcpy(buf, &msg[written], bytes); // Add trailing nul byte, plus newline unless there already is one strcpy(&buf[bytes], &"\n"[buf[bytes-1]=='\n']); process_notice_raw(buf); } } void pqxx::connection_base::process_notice(const std::string &msg) noexcept { // Ensure that message passed to errorhandler ends in newline if (msg[msg.size()-1] == '\n') { process_notice_raw(msg.c_str()); } else try { const std::string nl = msg + "\n"; process_notice_raw(nl.c_str()); } catch (const std::exception &) { // If nothing else works, try writing the message without the newline process_notice_raw(msg.c_str()); // This is ugly. process_notice_raw("\n"); } } void pqxx::connection_base::trace(FILE *Out) noexcept { m_trace = Out; if (m_conn) internal_set_trace(); } void pqxx::connection_base::add_receiver(pqxx::notification_receiver *T) { if (T == nullptr) throw argument_error{"Null receiver registered"}; // Add to receiver list and attempt to start listening. const auto p = m_receivers.find(T->channel()); const receiver_list::value_type NewVal(T->channel(), T); if (p == m_receivers.end()) { // Not listening on this event yet, start doing so. const std::string LQ("LISTEN " + quote_name(T->channel())); if (is_open()) try { check_result(make_result(PQexec(m_conn, LQ.c_str()), LQ)); } catch (const broken_connection &) { } m_receivers.insert(NewVal); } else { m_receivers.insert(p, NewVal); } } void pqxx::connection_base::remove_receiver(pqxx::notification_receiver *T) noexcept { if (T == nullptr) return; try { const std::pair needle{ T->channel(), T}; auto R = m_receivers.equal_range(needle.first); const auto i = find(R.first, R.second, needle); if (i == R.second) { process_notice( "Attempt to remove unknown receiver '" + needle.first + "'"); } else { // Erase first; otherwise a notification for the same receiver may yet // come in and wreak havoc. Thanks Dragan Milenkovic. const bool gone = (m_conn and (R.second == ++R.first)); m_receivers.erase(i); if (gone) exec(("UNLISTEN " + quote_name(needle.first)).c_str(), 0); } } catch (const std::exception &e) { process_notice(e.what()); } } bool pqxx::connection_base::consume_input() noexcept { return PQconsumeInput(m_conn) != 0; } bool pqxx::connection_base::is_busy() const noexcept { return PQisBusy(m_conn) != 0; } namespace { /// Stateful libpq "cancel" operation. class cancel_wrapper { PGcancel *m_cancel; char m_errbuf[500]; public: explicit cancel_wrapper(PGconn *conn) : m_cancel{nullptr}, m_errbuf{} { if (conn) { m_cancel = PQgetCancel(conn); if (m_cancel == nullptr) throw std::bad_alloc{}; } } ~cancel_wrapper() { if (m_cancel) PQfreeCancel(m_cancel); } void operator()() { if (not m_cancel) return; if (PQcancel(m_cancel, m_errbuf, int{sizeof(m_errbuf)}) == 0) throw sql_error{std::string{m_errbuf}}; } }; } void pqxx::connection_base::cancel_query() { cancel_wrapper cancel{m_conn}; cancel(); } void pqxx::connection_base::set_verbosity(error_verbosity verbosity) noexcept { PQsetErrorVerbosity(m_conn, static_cast(verbosity)); m_verbosity = verbosity; } namespace { /// Unique pointer to PGnotify. using notify_ptr = std::unique_ptr; /// Get one notification from a connection, or null. notify_ptr get_notif(pqxx::internal::pq::PGconn *conn) { return notify_ptr(PQnotifies(conn), freepqmem_templated); } } int pqxx::connection_base::get_notifs() { if (not is_open()) return 0; if (not consume_input()) throw broken_connection{}; // Even if somehow we receive notifications during our transaction, don't // deliver them. if (m_trans.get()) return 0; int notifs = 0; for (auto N = get_notif(m_conn); N.get(); N = get_notif(m_conn)) { notifs++; const auto Hit = m_receivers.equal_range(std::string{N->relname}); for (auto i = Hit.first; i != Hit.second; ++i) try { (*i->second)(N->extra, N->be_pid); } catch (const std::exception &e) { try { process_notice( "Exception in notification receiver '" + i->first + "': " + e.what() + "\n"); } catch (const std::bad_alloc &) { // Out of memory. Try to get the message out in a more robust way. process_notice( "Exception in notification receiver, " "and also ran out of memory\n"); } catch (const std::exception &) { process_notice( "Exception in notification receiver " "(compounded by other error)\n"); } } N.reset(); } return notifs; } const char *pqxx::connection_base::dbname() { #include if (m_conn == nullptr) activate(); #include return PQdb(m_conn); } const char *pqxx::connection_base::username() { #include if (m_conn == nullptr) activate(); #include return PQuser(m_conn); } const char *pqxx::connection_base::hostname() { #include if (m_conn == nullptr) activate(); #include return PQhost(m_conn); } const char *pqxx::connection_base::port() { #include if (m_conn == nullptr) activate(); #include return PQport(m_conn); } const char *pqxx::connection_base::err_msg() const noexcept { return m_conn ? PQerrorMessage(m_conn) : "No connection to database"; } void pqxx::connection_base::clear_notice_processor() { PQsetNoticeProcessor(m_conn, inert_notice_processor, nullptr); } void pqxx::connection_base::set_notice_processor() { PQsetNoticeProcessor(m_conn, pqxx_notice_processor, this); } void pqxx::connection_base::register_errorhandler(errorhandler *handler) { // Set notice processor on demand, i.e. only when the caller actually // registers an error handler. // We do this just to make it less likely that users fall into the trap // where a result object may hold a notice processor derived from its parent // connection which has already been destroyed. Our notice processor goes // through the connection's list of error handlers. If the connection object // has already been destroyed though, that list no longer exists. // By setting the notice processor on demand, we absolve users who never // register an error handler from ahving to care about this nasty subtlety. if (m_errorhandlers.empty()) set_notice_processor(); m_errorhandlers.push_back(handler); } void pqxx::connection_base::unregister_errorhandler(errorhandler *handler) noexcept { // The errorhandler itself will take care of nulling its pointer to this // connection. m_errorhandlers.remove(handler); if (m_errorhandlers.empty()) clear_notice_processor(); } std::vector pqxx::connection_base::get_errorhandlers() const { return std::vector{ std::begin(m_errorhandlers), std::end(m_errorhandlers)}; } pqxx::result pqxx::connection_base::exec(const char Query[], int Retries) { #include activate(); #include auto R = make_result(PQexec(m_conn, Query), Query); while ((Retries > 0) and not gate::result_connection{R} and not is_open()) { Retries--; reset(); if (is_open()) R = make_result(PQexec(m_conn, Query), Query); } check_result(R); get_notifs(); return R; } void pqxx::connection_base::prepare( const std::string &name, const std::string &definition) { auto i = m_prepared.find(name); if (i != m_prepared.end()) { if (definition != i->second.definition) { if (not name.empty()) throw argument_error{ "Inconsistent redefinition of prepared statement " + name}; i->second.registered = false; i->second.definition = definition; } } else { m_prepared.insert(make_pair( name, prepare::internal::prepared_def{definition})); } } void pqxx::connection_base::prepare(const std::string &definition) { this->prepare(std::string{}, definition); } void pqxx::connection_base::unprepare(const std::string &name) { auto i = m_prepared.find(name); // Quietly ignore duplicated or spurious unprepare()s if (i == m_prepared.end()) return; if (i->second.registered) exec(("DEALLOCATE " + quote_name(name)).c_str(), 0); m_prepared.erase(i); } pqxx::prepare::internal::prepared_def & pqxx::connection_base::find_prepared(const std::string &statement) { auto s = m_prepared.find(statement); if (s == m_prepared.end()) throw argument_error{"Unknown prepared statement '" + statement + "'"}; return s->second; } pqxx::prepare::internal::prepared_def & pqxx::connection_base::register_prepared(const std::string &name) { #include activate(); #include auto &s = find_prepared(name); // "Register" (i.e., define) prepared statement with backend on demand if (not s.registered) { auto r = make_result( PQprepare(m_conn, name.c_str(), s.definition.c_str(), 0, nullptr), "[PREPARE " + name + "]"); check_result(r); s.registered = not name.empty(); return s; } return s; } void pqxx::connection_base::prepare_now(const std::string &name) { register_prepared(name); } pqxx::result pqxx::connection_base::prepared_exec( const std::string &statement, const char *const params[], const int paramlengths[], const int binary[], int nparams) { register_prepared(statement); #include activate(); #include auto r = make_result( PQexecPrepared( m_conn, statement.c_str(), nparams, params, paramlengths, binary, 0), statement); check_result(r); get_notifs(); return r; } pqxx::result pqxx::connection_base::exec_prepared( const std::string &statement, const internal::params &args) { register_prepared(statement); #include activate(); #include const auto pointers = args.get_pointers(); const auto pq_result = PQexecPrepared( m_conn, statement.c_str(), int(args.nonnulls.size()), pointers.data(), args.lengths.data(), args.binaries.data(), 0); const auto r = make_result(pq_result, statement); check_result(r); get_notifs(); return r; } bool pqxx::connection_base::prepared_exists(const std::string &statement) const { auto s = m_prepared.find(statement); return s != PSMap::const_iterator(m_prepared.end()); } void pqxx::connection_base::reset() { if (m_inhibit_reactivation) throw broken_connection{ "Could not reset connection: reactivation is inhibited"}; if (m_reactivation_avoidance.get()) return; // TODO: Probably need to go through a full disconnect/reconnect! // Forget about any previously ongoing connection attempts m_conn = m_policy.do_dropconnect(m_conn); m_completed = false; if (m_conn) { // Reset existing connection PQreset(m_conn); set_up_state(); } else { // No existing connection--start a new one #include activate(); #include } } void pqxx::connection_base::close() noexcept { m_completed = false; #include inhibit_reactivation(false); #include m_reactivation_avoidance.clear(); try { if (m_trans.get()) process_notice( "Closing connection while " + m_trans.get()->description() + " still open"); if (not m_receivers.empty()) { process_notice("Closing connection with outstanding receivers."); m_receivers.clear(); } std::list old_handlers; m_errorhandlers.swap(old_handlers); const auto rbegin = old_handlers.crbegin(), rend = old_handlers.crend(); for (auto i = rbegin; i!=rend; ++i) gate::errorhandler_connection_base{**i}.unregister(); m_conn = m_policy.do_disconnect(m_conn); } catch (...) { } } void pqxx::connection_base::raw_set_var( const std::string &Var, const std::string &Value) { exec(("SET " + Var + "=" + Value).c_str(), 0); } void pqxx::connection_base::add_variables( const std::map &Vars) { for (auto &i: Vars) m_vars[i.first] = i.second; } void pqxx::connection_base::internal_set_trace() noexcept { if (m_conn) { if (m_trace) PQtrace(m_conn, m_trace); else PQuntrace(m_conn); } } int pqxx::connection_base::status() const noexcept { return PQstatus(m_conn); } void pqxx::connection_base::register_transaction(transaction_base *T) { m_trans.register_guest(T); } void pqxx::connection_base::unregister_transaction(transaction_base *T) noexcept { try { m_trans.unregister_guest(T); } catch (const std::exception &e) { process_notice(e.what()); } } bool pqxx::connection_base::read_copy_line(std::string &Line) { if (not is_open()) throw internal_error{"read_copy_line() without connection"}; Line.erase(); bool Result; char *Buf = nullptr; const std::string query = "[END COPY]"; const auto line_len = PQgetCopyData(m_conn, &Buf, false); switch (line_len) { case -2: throw failure{"Reading of table data failed: " + std::string{err_msg()}}; case -1: for ( auto R = make_result(PQgetResult(m_conn), query); gate::result_connection(R); R=make_result(PQgetResult(m_conn), query) ) check_result(R); Result = false; break; case 0: throw internal_error{"table read inexplicably went asynchronous"}; default: if (Buf) { std::unique_ptr PQA( Buf, freepqmem_templated); Line.assign(Buf, unsigned(line_len)); } Result = true; } return Result; } void pqxx::connection_base::write_copy_line(const std::string &Line) { if (not is_open()) throw internal_error{"write_copy_line() without connection"}; const std::string L = Line + '\n'; const char *const LC = L.c_str(); const auto Len = L.size(); if (PQputCopyData(m_conn, LC, int(Len)) <= 0) { const std::string msg = ( std::string{"Error writing to table: "} + err_msg()); // TODO: PQendcopy() is documented as obsolete! PQendcopy(m_conn); throw failure{msg}; } } void pqxx::connection_base::end_copy_write() { int Res = PQputCopyEnd(m_conn, nullptr); switch (Res) { case -1: throw failure{"Write to table failed: " + std::string{err_msg()}}; case 0: throw internal_error{"table write is inexplicably asynchronous"}; case 1: // Normal termination. Retrieve result object. break; default: throw internal_error{ "unexpected result " + to_string(Res) + " from PQputCopyEnd()"}; } check_result(make_result(PQgetResult(m_conn), "[END COPY]")); } void pqxx::connection_base::start_exec(const std::string &Q) { #include activate(); #include if (PQsendQuery(m_conn, Q.c_str()) == 0) throw failure{err_msg()}; } pqxx::internal::pq::PGresult *pqxx::connection_base::get_result() { if (m_conn == nullptr) throw broken_connection{}; return PQgetResult(m_conn); } void pqxx::connection_base::add_reactivation_avoidance_count(int n) { m_reactivation_avoidance.add(n); } std::string pqxx::connection_base::esc(const char str[], size_t maxlen) { // We need a connection object... This is the one reason why this function is // not const! #include if (m_conn == nullptr) activate(); #include std::vector buf(2 * maxlen + 1); int err = 0; // TODO: Can we make a callback-based string_view alternative to this? // TODO: If we can, then quote() can wrap PQescapeLiteral()! PQescapeStringConn(m_conn, buf.data(), str, maxlen, &err); if (err) throw argument_error{err_msg()}; return std::string{buf.data()}; } std::string pqxx::connection_base::esc(const char str[]) { return this->esc(str, strlen(str)); } std::string pqxx::connection_base::esc(const std::string &str) { return this->esc(str.c_str(), str.size()); } std::string pqxx::connection_base::esc_raw( const unsigned char str[], size_t len) { size_t bytes = 0; // We need a connection object... This is the one reason why this function is // not const! #include activate(); #include std::unique_ptr buf{ PQescapeByteaConn(m_conn, str, len, &bytes), freepqmem_templated}; if (buf.get() == nullptr) throw std::bad_alloc{}; return std::string{reinterpret_cast(buf.get())}; } std::string pqxx::connection_base::unesc_raw(const char *text) { size_t len; unsigned char *bytes = const_cast( reinterpret_cast(text)); const std::unique_ptr ptr{ PQunescapeBytea(bytes, &len), internal::freepqmem}; return std::string{ptr.get(), ptr.get() + len}; } std::string pqxx::connection_base::quote_raw( const unsigned char str[], size_t len) { return "'" + esc_raw(str, len) + "'::bytea"; } std::string pqxx::connection_base::quote(const binarystring &b) { return quote_raw(b.data(), b.size()); } std::string pqxx::connection_base::quote_name(const std::string &identifier) { // We need a connection object... This is the one reason why this function is // not const! #include activate(); #include std::unique_ptr buf{ PQescapeIdentifier(m_conn, identifier.c_str(), identifier.size()), freepqmem_templated}; if (buf.get() == nullptr) throw failure{err_msg()}; return std::string{buf.get()}; } std::string pqxx::connection_base::esc_like( const std::string &str, char escape_char) const { std::string out; out.reserve(str.size()); internal::for_glyphs( internal::enc_group(encoding_id()), [&out, escape_char](const char *gbegin, const char *gend) { if ((gend - gbegin == 1) and (*gbegin == '_' or *gbegin == '%')) out.push_back(escape_char); for (; gbegin != gend; ++gbegin) out.push_back(*gbegin); }, str.c_str(), str.size()); return out; } pqxx::internal::reactivation_avoidance_exemption:: reactivation_avoidance_exemption( connection_base &C) : m_home{C}, m_count{gate::connection_reactivation_avoidance_exemption(C).get_counter()}, m_open{C.is_open()} { gate::connection_reactivation_avoidance_exemption gate{C}; gate.clear_counter(); } pqxx::internal::reactivation_avoidance_exemption:: ~reactivation_avoidance_exemption() { // Don't leave the connection open if reactivation avoidance is in effect and // the connection needed to be reactivated temporarily. if (m_count and not m_open) { #include "pqxx/internal/ignore-deprecated-pre.hxx" m_home.deactivate(); #include "pqxx/internal/ignore-deprecated-post.hxx" } gate::connection_reactivation_avoidance_exemption gate{m_home}; gate.add_counter(m_count); } namespace { #if defined(_WIN32) || defined(HAVE_POLL) // Convert a timeval to milliseconds, or -1 if no timeval is given. inline int tv_milliseconds(timeval *tv = nullptr) { return tv ? int(tv->tv_sec * 1000 + tv->tv_usec/1000) : -1; } #endif /// Wait for an fd to become free for reading/writing. Optional timeout. void wait_fd(int fd, bool forwrite=false, timeval *tv=nullptr) { if (fd < 0) throw pqxx::broken_connection{}; // WSAPoll is available in winsock2.h only for versions of Windows >= 0x0600 #if defined(_WIN32) && (_WIN32_WINNT >= 0x0600) const short events = (forwrite ? POLLWRNORM : POLLRDNORM); WSAPOLLFD fdarray{SOCKET(fd), events, 0}; WSAPoll(&fdarray, 1, tv_milliseconds(tv)); #elif defined(HAVE_POLL) const short events = short( POLLERR|POLLHUP|POLLNVAL | (forwrite?POLLOUT:POLLIN)); pollfd pfd{fd, events, 0}; poll(&pfd, 1, tv_milliseconds(tv)); #else // No poll()? Our last option is select(). fd_set read_fds; FD_ZERO(&read_fds); if (not forwrite) FD_SET(fd, &read_fds); fd_set write_fds; FD_ZERO(&write_fds); if (forwrite) FD_SET(fd, &write_fds); fd_set except_fds; FD_ZERO(&except_fds); FD_SET(fd, &except_fds); select(fd+1, &read_fds, &write_fds, &except_fds, tv); #endif // No need to report errors. The caller will try to use the file // descriptor right after we return, so if the file descriptor is broken, // the caller will notice soon enough. } } // namespace void pqxx::internal::wait_read(const internal::pq::PGconn *c) { wait_fd(socket_of(c)); } void pqxx::internal::wait_read( const internal::pq::PGconn *c, long seconds, long microseconds) { // These are really supposed to be time_t and suseconds_t. But not all // platforms have that type; some use "long" instead, and some 64-bit // systems use 32-bit integers here. So "int" seems to be the only really // safe type to use. timeval tv = { time_t(seconds), int(microseconds) }; wait_fd(socket_of(c), false, &tv); } void pqxx::internal::wait_write(const internal::pq::PGconn *c) { wait_fd(socket_of(c), true); } void pqxx::connection_base::wait_read() const { internal::wait_read(m_conn); } void pqxx::connection_base::wait_read(long seconds, long microseconds) const { internal::wait_read(m_conn, seconds, microseconds); } void pqxx::connection_base::wait_write() const { internal::wait_write(m_conn); } int pqxx::connection_base::await_notification() { #include activate(); #include int notifs = get_notifs(); if (notifs == 0) { wait_read(); notifs = get_notifs(); } return notifs; } int pqxx::connection_base::await_notification(long seconds, long microseconds) { #include activate(); #include int notifs = get_notifs(); if (notifs == 0) { wait_read(seconds, microseconds); notifs = get_notifs(); } return notifs; } void pqxx::connection_base::read_capabilities() { m_serverversion = PQserverVersion(m_conn); if (m_serverversion <= 90000) throw feature_not_supported{ "Unsupported server version; 9.0 is the minimum."}; switch (protocol_version()) { case 0: throw broken_connection{}; case 1: case 2: throw feature_not_supported{ "Unsupported frontend/backend protocol version; 3.0 is the minimum."}; default: break; } // TODO: Check for capabilities here. Currently don't need any checks. } std::string pqxx::connection_base::adorn_name(const std::string &n) { const std::string id = to_string(++m_unique_id); return n.empty() ? ("x"+id) : (n+"_"+id); } std::string pqxx::connection_base::get_client_encoding() const { return internal::name_encoding(encoding_id()); } void pqxx::connection_base::set_client_encoding(const char encoding[]) { const auto retval = PQsetClientEncoding(m_conn, encoding); switch (retval) { case 0: // OK. break; case -1: // TODO: Any helpful information we could give here? throw failure{"Setting client encoding failed."}; default: throw internal_error{ "Unexpected result from PQsetClientEncoding: " + to_string(retval)}; } } void pqxx::connection_base::set_client_encoding(const std::string &encoding) { set_client_encoding(encoding.c_str()); } int pqxx::connection_base::encoding_id() const { const int enc = PQclientEncoding(m_conn); if (enc == -1) { if (not is_open()) throw broken_connection{ "Could not obtain client encoding: not connected."}; throw failure{"Could not obtain client encoding."}; } return enc; } pqxx::result pqxx::connection_base::parameterized_exec( const std::string &query, const char *const params[], const int paramlengths[], const int binaries[], int nparams) { auto r = make_result( PQexecParams( m_conn, query.c_str(), nparams, nullptr, params, paramlengths, binaries, 0), query); check_result(r); get_notifs(); return r; } pqxx::result pqxx::connection_base::exec_params( const std::string &query, const internal::params &args) { const auto pointers = args.get_pointers(); const auto pq_result = PQexecParams( m_conn, query.c_str(), int(args.nonnulls.size()), nullptr, pointers.data(), args.lengths.data(), args.binaries.data(), 0); const auto r = make_result(pq_result, query); check_result(r); get_notifs(); return r; } libpqxx-6.4.5/src/cursor.cxx000066400000000000000000000172261350065432700160620ustar00rootroot00000000000000/** Implementation of libpqxx STL-style cursor classes. * * These classes wrap SQL cursors in STL-like interfaces. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/cursor" #include "pqxx/result" #include "pqxx/strconv" #include "pqxx/transaction" #include "pqxx/internal/gates/icursor_iterator-icursorstream.hxx" #include "pqxx/internal/gates/icursorstream-icursor_iterator.hxx" using namespace pqxx; using namespace pqxx::internal; pqxx::cursor_base::difference_type pqxx::cursor_base::all() noexcept { // Implemented out-of-line so we don't fall afoul of Visual Studio defining // min() and max() macros, which turn this expression into malformed code: return std::numeric_limits::max() - 1; } pqxx::cursor_base::difference_type cursor_base::backward_all() noexcept { // Implemented out-of-line so we don't fall afoul of Visual Studio defining // min() and max() macros, which turn this expression into malformed code: return std::numeric_limits::min() + 1; } pqxx::cursor_base::cursor_base( connection_base &context, const std::string &Name, bool embellish_name) : m_name{embellish_name ? context.adorn_name(Name) : Name} { } result::size_type pqxx::internal::obtain_stateless_cursor_size(sql_cursor &cur) { if (cur.endpos() == -1) cur.move(cursor_base::all()); return result::size_type(cur.endpos() - 1); } result pqxx::internal::stateless_cursor_retrieve( sql_cursor &cur, result::difference_type size, result::difference_type begin_pos, result::difference_type end_pos) { if (begin_pos < 0 or begin_pos > size) throw range_error{"Starting position out of range"}; if (end_pos < -1) end_pos = -1; else if (end_pos > size) end_pos = size; if (begin_pos == end_pos) return cur.empty_result(); const int direction = ((begin_pos < end_pos) ? 1 : -1); cur.move((begin_pos-direction) - (cur.pos()-1)); return cur.fetch(end_pos - begin_pos); } pqxx::icursorstream::icursorstream( transaction_base &context, const std::string &query, const std::string &basename, difference_type sstride) : m_cur{context, query, basename, cursor_base::forward_only, cursor_base::read_only, cursor_base::owned, false}, m_stride{sstride}, m_realpos{0}, m_reqpos{0}, m_iterators{nullptr}, m_done{false} { set_stride(sstride); } pqxx::icursorstream::icursorstream( transaction_base &context, const field &cname, difference_type sstride, cursor_base::ownershippolicy op) : m_cur{context, cname.c_str(), op}, m_stride{sstride}, m_realpos{0}, m_reqpos{0}, m_iterators{nullptr}, m_done{false} { set_stride(sstride); } void pqxx::icursorstream::set_stride(difference_type n) { if (n < 1) throw argument_error{"Attempt to set cursor stride to " + to_string(n)}; m_stride = n; } result pqxx::icursorstream::fetchblock() { const result r{m_cur.fetch(m_stride)}; m_realpos += r.size(); if (r.empty()) m_done = true; return r; } icursorstream &pqxx::icursorstream::ignore(std::streamsize n) { auto offset = m_cur.move(difference_type(n)); m_realpos += offset; if (offset < n) m_done = true; return *this; } icursorstream::size_type pqxx::icursorstream::forward(size_type n) { m_reqpos += difference_type(n) * m_stride; return icursorstream::size_type(m_reqpos); } void pqxx::icursorstream::insert_iterator(icursor_iterator *i) noexcept { gate::icursor_iterator_icursorstream{*i}.set_next(m_iterators); if (m_iterators) gate::icursor_iterator_icursorstream{*m_iterators}.set_prev(i); m_iterators = i; } void pqxx::icursorstream::remove_iterator(icursor_iterator *i) const noexcept { gate::icursor_iterator_icursorstream igate{*i}; if (i == m_iterators) { m_iterators = igate.get_next(); if (m_iterators) gate::icursor_iterator_icursorstream{*m_iterators}.set_prev(nullptr); } else { auto prev = igate.get_prev(), next = igate.get_next(); gate::icursor_iterator_icursorstream{*prev}.set_next(next); if (next) gate::icursor_iterator_icursorstream{*next}.set_prev(prev); } igate.set_prev(nullptr); igate.set_next(nullptr); } void pqxx::icursorstream::service_iterators(difference_type topos) { if (topos < m_realpos) return; using todolist = std::multimap; todolist todo; for (icursor_iterator *i = m_iterators, *next; i; i = next) { gate::icursor_iterator_icursorstream gate{*i}; const auto ipos = gate.pos(); if (ipos >= m_realpos and ipos <= topos) todo.insert(todolist::value_type(ipos, i)); next = gate.get_next(); } const auto todo_end = std::end(todo); for (auto i = std::begin(todo); i != todo_end; ) { const auto readpos = i->first; if (readpos > m_realpos) ignore(readpos - m_realpos); const result r = fetchblock(); for ( ; i != todo_end and i->first == readpos; ++i) gate::icursor_iterator_icursorstream{*i->second}.fill(r); } } pqxx::icursor_iterator::icursor_iterator() noexcept : m_pos{0} { } pqxx::icursor_iterator::icursor_iterator(istream_type &s) noexcept : m_stream{&s}, m_pos{difference_type(gate::icursorstream_icursor_iterator(s).forward(0))} { gate::icursorstream_icursor_iterator{*m_stream}.insert_iterator(this); } pqxx::icursor_iterator::icursor_iterator(const icursor_iterator &rhs) noexcept : m_stream{rhs.m_stream}, m_here{rhs.m_here}, m_pos{rhs.m_pos} { if (m_stream) gate::icursorstream_icursor_iterator{*m_stream}.insert_iterator(this); } pqxx::icursor_iterator::~icursor_iterator() noexcept { if (m_stream) gate::icursorstream_icursor_iterator{*m_stream}.remove_iterator(this); } icursor_iterator pqxx::icursor_iterator::operator++(int) { icursor_iterator old{*this}; m_pos = difference_type( gate::icursorstream_icursor_iterator{*m_stream}.forward()); m_here.clear(); return old; } icursor_iterator &pqxx::icursor_iterator::operator++() { m_pos = difference_type( gate::icursorstream_icursor_iterator{*m_stream}.forward()); m_here.clear(); return *this; } icursor_iterator &pqxx::icursor_iterator::operator+=(difference_type n) { if (n <= 0) { if (n == 0) return *this; throw argument_error{"Advancing icursor_iterator by negative offset."}; } m_pos = difference_type( gate::icursorstream_icursor_iterator{*m_stream}.forward( icursorstream::size_type(n))); m_here.clear(); return *this; } icursor_iterator & pqxx::icursor_iterator::operator=(const icursor_iterator &rhs) noexcept { if (rhs.m_stream == m_stream) { m_here = rhs.m_here; m_pos = rhs.m_pos; } else { if (m_stream) gate::icursorstream_icursor_iterator{*m_stream}.remove_iterator(this); m_here = rhs.m_here; m_pos = rhs.m_pos; m_stream = rhs.m_stream; if (m_stream) gate::icursorstream_icursor_iterator{*m_stream}.insert_iterator(this); } return *this; } bool pqxx::icursor_iterator::operator==(const icursor_iterator &rhs) const { if (m_stream == rhs.m_stream) return pos() == rhs.pos(); if (m_stream and rhs.m_stream) return false; refresh(); rhs.refresh(); return m_here.empty() and rhs.m_here.empty(); } bool pqxx::icursor_iterator::operator<(const icursor_iterator &rhs) const { if (m_stream == rhs.m_stream) return pos() < rhs.pos(); refresh(); rhs.refresh(); return not m_here.empty(); } void pqxx::icursor_iterator::refresh() const { if (m_stream) gate::icursorstream_icursor_iterator{*m_stream}.service_iterators(pos()); } void pqxx::icursor_iterator::fill(const result &r) { m_here = r; } libpqxx-6.4.5/src/dbtransaction.cxx000066400000000000000000000042011350065432700173650ustar00rootroot00000000000000/** Implementation of the pqxx::dbtransaction class. * * pqxx::dbtransaction represents a real backend transaction. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/dbtransaction" #include "pqxx/internal/gates/connection-dbtransaction.hxx" using namespace pqxx::internal; namespace { std::string generate_set_transaction( pqxx::readwrite_policy rw, const std::string &IsolationString=std::string{}) { std::string args; if (not IsolationString.empty()) if (IsolationString != pqxx::isolation_traits::name()) args += " ISOLATION LEVEL " + IsolationString; if (rw != pqxx::read_write) args += " READ ONLY"; return args.empty() ? "BEGIN" : ("BEGIN; SET TRANSACTION" + args); } } // namespace pqxx::dbtransaction::dbtransaction( connection_base &C, const std::string &IsolationString, readwrite_policy rw) : namedclass{"dbtransaction"}, transaction_base{C}, m_start_cmd{generate_set_transaction(rw, IsolationString)} { } pqxx::dbtransaction::dbtransaction( connection_base &C, bool direct, readwrite_policy rw) : namedclass{"dbtransaction"}, transaction_base(C, direct), m_start_cmd{generate_set_transaction(rw)} { } pqxx::dbtransaction::~dbtransaction() { } void pqxx::dbtransaction::do_begin() { const gate::connection_dbtransaction gate(conn()); const int avoidance_counter = gate.get_reactivation_avoidance_count(); direct_exec(m_start_cmd.c_str(), avoidance_counter ? 0 : 2); } pqxx::result pqxx::dbtransaction::do_exec(const char Query[]) { try { return direct_exec(Query); } catch (const std::exception &) { try { abort(); } catch (const std::exception &) {} throw; } } void pqxx::dbtransaction::do_abort() { reactivation_avoidance_clear(); direct_exec("ROLLBACK"); } std::string pqxx::dbtransaction::fullname(const std::string &ttype, const std::string &isolation) { return ttype + "<" + isolation + ">"; } libpqxx-6.4.5/src/encodings.cxx000066400000000000000000000534761350065432700165250ustar00rootroot00000000000000/** Implementation of string encodings support * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/except.hxx" #include "pqxx/internal/encodings.hxx" #include #include #include #include using namespace pqxx::internal; extern "C" { #include "libpq-fe.h" } // Internal helper functions namespace { /// Extract byte from buffer, return as unsigned char. unsigned char get_byte(const char buffer[], std::string::size_type offset) { return static_cast(buffer[offset]); } [[noreturn]] void throw_for_encoding_error( const char* encoding_name, const char buffer[], std::string::size_type start, std::string::size_type count ) { std::stringstream s; s << "Invalid byte sequence for encoding " << encoding_name << " at byte " << start << ": " << std::hex << std::setw(2) << std::setfill('0') ; for (std::string::size_type i{0}; i < count; ++i) { s << "0x" << static_cast(get_byte(buffer, start + i)); if (i + 1 < count) s << " "; } throw pqxx::argument_error{s.str()}; } /// Does value lie between bottom and top, inclusive? constexpr bool between_inc(unsigned char value, unsigned bottom, unsigned top) { return value >= bottom and value <= top; } /* EUC-JP and EUC-JIS-2004 represent slightly different code points but iterate the same: * https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-JP * http://x0213.org/codetable/index.en.html */ std::string::size_type next_seq_for_euc_jplike( const char buffer[], std::string::size_type buffer_len, std::string::size_type start, const char encoding_name[]) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error(encoding_name, buffer, start, 1); const auto byte2 = get_byte(buffer, start + 1); if (byte1 == 0x8e) { if (not between_inc(byte2, 0xa1, 0xfe)) throw_for_encoding_error(encoding_name, buffer, start, 2); return start + 2; } if (between_inc(byte1, 0xa1, 0xfe)) { if (not between_inc(byte2, 0xa1, 0xfe)) throw_for_encoding_error(encoding_name, buffer, start, 2); return start + 2; } if (byte1 == 0x8f and start + 3 <= buffer_len) { const auto byte3 = get_byte(buffer, start + 2); if ( not between_inc(byte2, 0xa1, 0xfe) or not between_inc(byte3, 0xa1, 0xfe) ) throw_for_encoding_error(encoding_name, buffer, start, 3); return start + 3; } throw_for_encoding_error(encoding_name, buffer, start, 1); } /* As far as I can tell, for the purposes of iterating the only difference between SJIS and SJIS-2004 is increased range in the first byte of two-byte sequences (0xEF increased to 0xFC). Officially, that is; apparently the version of SJIS used by Postgres has the same range as SJIS-2004. They both have increased range over the documented versions, not having the even/odd restriction for the first byte in 2-byte sequences. */ // https://en.wikipedia.org/wiki/Shift_JIS#Shift_JIS_byte_map // http://x0213.org/codetable/index.en.html std::string::size_type next_seq_for_sjislike( const char buffer[], std::string::size_type buffer_len, std::string::size_type start, const char* encoding_name ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80 or between_inc(byte1, 0xa1, 0xdf)) return start + 1; if ( not between_inc(byte1, 0x81, 0x9f) and not between_inc(byte1, 0xe0, 0xfc) ) throw_for_encoding_error(encoding_name, buffer, start, 1); if (start + 2 > buffer_len) throw_for_encoding_error( encoding_name, buffer, start, buffer_len - start); const auto byte2 = get_byte(buffer, start + 1); if (byte2 == 0x7f) throw_for_encoding_error(encoding_name, buffer, start, 2); if (between_inc(byte2, 0x40, 0x9e) or between_inc(byte2, 0x9f, 0xfc)) return start + 2; throw_for_encoding_error(encoding_name, buffer, start, 2); } } // namespace // Implement template specializations first namespace pqxx { namespace internal { template struct glyph_scanner { static std::string::size_type call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start); }; template<> std::string::size_type glyph_scanner::call( const char /* buffer */[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; else return start + 1; } // https://en.wikipedia.org/wiki/Big5#Organization template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (not between_inc(byte1, 0x81, 0xfe) or (start + 2 > buffer_len)) throw_for_encoding_error("BIG5", buffer, start, 1); const auto byte2 = get_byte(buffer, start + 1); if ( not between_inc(byte2, 0x40, 0x7e) and not between_inc(byte2, 0xa1, 0xfe)) throw_for_encoding_error("BIG5", buffer, start, 2); return start + 2; } /* The PostgreSQL documentation claims that the EUC_* encodings are 1-3 bytes each, but other documents explain that the EUC sets can contain 1-(2,3,4) bytes depending on the specific extension: EUC_CN : 1-2 EUC_JP : 1-3 EUC_JIS_2004: 1-2 EUC_KR : 1-2 EUC_TW : 1-4 */ // https://en.wikipedia.org/wiki/GB_2312#EUC-CN template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (not between_inc(byte1, 0xa1, 0xf7) or start + 2 > buffer_len) throw_for_encoding_error("EUC_CN", buffer, start, 1); const auto byte2 = get_byte(buffer, start + 1); if (not between_inc(byte2, 0xa1, 0xfe)) throw_for_encoding_error("EUC_CN", buffer, start, 2); return start + 2; } template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { return next_seq_for_euc_jplike(buffer, buffer_len, start, "EUC_JP"); } template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { return next_seq_for_euc_jplike(buffer, buffer_len, start, "EUC_JIS_2004"); } // https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-KR template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (not between_inc(byte1, 0xa1, 0xfe) or start + 2 > buffer_len) throw_for_encoding_error("EUC_KR", buffer, start, 1); const auto byte2 = get_byte(buffer, start + 1); if (not between_inc(byte2, 0xa1, 0xfe)) throw_for_encoding_error("EUC_KR", buffer, start, 1); return start + 2; } // https://en.wikipedia.org/wiki/Extended_Unix_Code#EUC-TW template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error("EUC_KR", buffer, start, 1); const auto byte2 = get_byte(buffer, start + 1); if (between_inc(byte1, 0xa1, 0xfe)) { if (not between_inc(byte2, 0xa1, 0xfe)) throw_for_encoding_error("EUC_KR", buffer, start, 2); return start + 2; } if (byte1 != 0x8e or start + 4 > buffer_len) throw_for_encoding_error("EUC_KR", buffer, start, 1); if ( between_inc(byte2, 0xa1, 0xb0) and between_inc(get_byte(buffer, start + 2), 0xa1, 0xfe) and between_inc(get_byte(buffer, start + 3), 0xa1, 0xfe) ) return start + 4; throw_for_encoding_error("EUC_KR", buffer, start, 4); } // https://en.wikipedia.org/wiki/GB_18030#Mapping template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (between_inc(byte1, 0x80, 0xff)) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error("GB18030", buffer, start, buffer_len - start); const auto byte2 = get_byte(buffer, start + 1); if (between_inc(byte2, 0x40, 0xfe)) { if (byte2 == 0x7f) throw_for_encoding_error("GB18030", buffer, start, 2); return start + 2; } if (start + 4 > buffer_len) throw_for_encoding_error("GB18030", buffer, start, buffer_len - start); if ( between_inc(byte2, 0x30, 0x39) and between_inc(get_byte(buffer, start + 2), 0x81, 0xfe) and between_inc(get_byte(buffer, start + 3), 0x30, 0x39) ) return start + 4; throw_for_encoding_error("GB18030", buffer, start, 4); } // https://en.wikipedia.org/wiki/GBK_(character_encoding)#Encoding template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error("GBK", buffer, start, 1); const auto byte2 = get_byte(buffer, start + 1); if ( (between_inc(byte1, 0xa1, 0xa9) and between_inc(byte2, 0xa1, 0xfe)) or (between_inc(byte1, 0xb0, 0xf7) and between_inc(byte2, 0xa1, 0xfe)) or ( between_inc(byte1, 0x81, 0xa0) and between_inc(byte2, 0x40, 0xfe) and byte2 != 0x7f ) or ( between_inc(byte1, 0xaa, 0xfe) and between_inc(byte2, 0x40, 0xa0) and byte2 != 0x7f ) or ( between_inc(byte1, 0xa8, 0xa9) and between_inc(byte2, 0x40, 0xa0) and byte2 != 0x7f ) or (between_inc(byte1, 0xaa, 0xaf) and between_inc(byte2, 0xa1, 0xfe)) or (between_inc(byte1, 0xf8, 0xfe) and between_inc(byte2, 0xa1, 0xfe)) or ( between_inc(byte1, 0xa1, 0xa7) and between_inc(byte2, 0x40, 0xa0) and byte2 != 0x7f ) ) return start + 2; throw_for_encoding_error("GBK", buffer, start, 2); } /* The PostgreSQL documentation claims that the JOHAB encoding is 1-3 bytes, but "CJKV Information Processing" describes it (actually just the Hangul portion) as "three five-bit segments" that reside inside 16 bits (2 bytes). CJKV Information Processing by Ken Lunde, pg. 269: https://bit.ly/2BEOu5V */ template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error("JOHAB", buffer, start, 1); const auto byte2 = get_byte(buffer, start); if ( ( between_inc(byte1, 0x84, 0xd3) and (between_inc(byte2, 0x41, 0x7e) or between_inc(byte2, 0x81, 0xfe)) ) or ( (between_inc(byte1, 0xd8, 0xde) or between_inc(byte1, 0xe0, 0xf9)) and (between_inc(byte2, 0x31, 0x7e) or between_inc(byte2, 0x91, 0xfe)) ) ) return start + 2; throw_for_encoding_error("JOHAB", buffer, start, 2); } /* PostgreSQL's MULE_INTERNAL is the emacs rather than Xemacs implementation; see the server/mb/pg_wchar.h PostgreSQL header file. This is implemented according to the description in said header file, but I was unable to get it to successfully iterate a MULE-encoded test CSV generated using PostgreSQL 9.2.23. Use this at your own risk. */ template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error("MULE_INTERNAL", buffer, start, 1); const auto byte2 = get_byte(buffer, start + 1); if (between_inc(byte1, 0x81, 0x8d) and byte2 >= 0xA0) return start + 2; if (start + 3 > buffer_len) throw_for_encoding_error("MULE_INTERNAL", buffer, start, 2); if ( ( (byte1 == 0x9A and between_inc(byte2, 0xa0, 0xdf)) or (byte1 == 0x9B and between_inc(byte2, 0xe0, 0xef)) or (between_inc(byte1, 0x90, 0x99) and byte2 >= 0xa0) ) and ( byte2 >= 0xA0 ) ) return start + 3; if (start + 4 > buffer_len) throw_for_encoding_error("MULE_INTERNAL", buffer, start, 3); if ( ( (byte1 == 0x9C and between_inc(byte2, 0xf0, 0xf4)) or (byte1 == 0x9D and between_inc(byte2, 0xf5, 0xfe)) ) and get_byte(buffer, start + 2) >= 0xa0 and get_byte(buffer, start + 4) >= 0xa0 ) return start + 4; throw_for_encoding_error("MULE_INTERNAL", buffer, start, 4); } template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { return next_seq_for_sjislike(buffer, buffer_len, start, "SJIS"); } template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { return next_seq_for_sjislike(buffer, buffer_len, start, "SHIFT_JIS_2004"); } // https://en.wikipedia.org/wiki/Unified_Hangul_Code template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error("UHC", buffer, start, buffer_len - start); const auto byte2 = get_byte(buffer, start + 1); if (between_inc(byte1, 0x80, 0xc6)) { if ( between_inc(byte2, 0x41, 0x5a) or between_inc(byte2, 0x61, 0x7a) or between_inc(byte2, 0x80, 0xfe) ) return start + 2; throw_for_encoding_error("UHC", buffer, start, 2); } if (between_inc(byte1, 0xa1, 0xfe)) { if (not between_inc(byte2, 0xa1, 0xfe)) throw_for_encoding_error("UHC", buffer, start, 2); return start + 2; } throw_for_encoding_error("UHC", buffer, start, 1); } // https://en.wikipedia.org/wiki/UTF-8#Description template<> std::string::size_type glyph_scanner::call( const char buffer[], std::string::size_type buffer_len, std::string::size_type start ) { if (start >= buffer_len) return std::string::npos; const auto byte1 = get_byte(buffer, start); if (byte1 < 0x80) return start + 1; if (start + 2 > buffer_len) throw_for_encoding_error("UTF8", buffer, start, buffer_len - start); const auto byte2 = get_byte(buffer, start + 1); if (between_inc(byte1, 0xc0, 0xdf)) { if (not between_inc(byte2, 0x80, 0xbf)) throw_for_encoding_error("UTF8", buffer, start, 2); return start + 2; } if (start + 3 > buffer_len) throw_for_encoding_error("UTF8", buffer, start, buffer_len - start); const auto byte3 = get_byte(buffer, start + 2); if (between_inc(byte1, 0xe0, 0xef)) { if (between_inc(byte2, 0x80, 0xbf) and between_inc(byte3, 0x80, 0xbf)) return start + 3; throw_for_encoding_error("UTF8", buffer, start, 3); } if (start + 4 > buffer_len) throw_for_encoding_error("UTF8", buffer, start, buffer_len - start); if (between_inc(byte1, 0xf0, 0xf7)) { if ( between_inc(byte2, 0x80, 0xbf) and between_inc(byte3, 0x80, 0xbf) and between_inc(get_byte(buffer, start + 3), 0x80, 0xbf) ) return start + 4; throw_for_encoding_error("UTF8", buffer, start, 4); } throw_for_encoding_error("UTF8", buffer, start, 1); } const char *name_encoding(int encoding_id) { return pg_encoding_to_char(encoding_id); } encoding_group enc_group(int libpq_enc_id) { return enc_group(name_encoding(libpq_enc_id)); } encoding_group enc_group(const std::string& encoding_name) { static const std::map encoding_map{ {"BIG5", encoding_group::BIG5}, {"EUC_CN", encoding_group::EUC_CN}, {"EUC_JP", encoding_group::EUC_JP}, {"EUC_JIS_2004", encoding_group::EUC_JIS_2004}, {"EUC_KR", encoding_group::EUC_KR}, {"EUC_TW", encoding_group::EUC_TW}, {"GB18030", encoding_group::GB18030}, {"GBK", encoding_group::GBK}, {"ISO_8859_5", encoding_group::MONOBYTE}, {"ISO_8859_6", encoding_group::MONOBYTE}, {"ISO_8859_7", encoding_group::MONOBYTE}, {"ISO_8859_8", encoding_group::MONOBYTE}, {"JOHAB", encoding_group::JOHAB}, {"KOI8R", encoding_group::MONOBYTE}, {"KOI8U", encoding_group::MONOBYTE}, {"LATIN1", encoding_group::MONOBYTE}, {"LATIN2", encoding_group::MONOBYTE}, {"LATIN3", encoding_group::MONOBYTE}, {"LATIN4", encoding_group::MONOBYTE}, {"LATIN5", encoding_group::MONOBYTE}, {"LATIN6", encoding_group::MONOBYTE}, {"LATIN7", encoding_group::MONOBYTE}, {"LATIN8", encoding_group::MONOBYTE}, {"LATIN9", encoding_group::MONOBYTE}, {"LATIN10", encoding_group::MONOBYTE}, {"MULE_INTERNAL", encoding_group::MULE_INTERNAL}, {"SJIS", encoding_group::SJIS}, {"SHIFT_JIS_2004", encoding_group::SHIFT_JIS_2004}, {"SQL_ASCII", encoding_group::MONOBYTE}, {"UHC", encoding_group::UHC}, {"UTF8", encoding_group::UTF8}, {"WIN866", encoding_group::MONOBYTE}, {"WIN874", encoding_group::MONOBYTE}, {"WIN1250", encoding_group::MONOBYTE}, {"WIN1251", encoding_group::MONOBYTE}, {"WIN1252", encoding_group::MONOBYTE}, {"WIN1253", encoding_group::MONOBYTE}, {"WIN1254", encoding_group::MONOBYTE}, {"WIN1255", encoding_group::MONOBYTE}, {"WIN1256", encoding_group::MONOBYTE}, {"WIN1257", encoding_group::MONOBYTE}, {"WIN1258", encoding_group::MONOBYTE}, }; const auto found_encoding_group = encoding_map.find(encoding_name); if (found_encoding_group == encoding_map.end()) throw std::invalid_argument{ "unrecognized encoding '" + encoding_name + "'" }; return found_encoding_group->second; } /// Look up instantiation @c T::call at runtime. /** Here, "T" is a struct template with a static member function "call", whose * type is "F". * * The return value is a pointer to the "call" member function for the * instantiation of T for encoding group enc. */ template class T, typename F> inline F *for_encoding(encoding_group enc) { #define CASE_GROUP(ENC) \ case encoding_group::ENC: return T::call switch (enc) { CASE_GROUP(MONOBYTE); CASE_GROUP(BIG5); CASE_GROUP(EUC_CN); CASE_GROUP(EUC_JP); CASE_GROUP(EUC_JIS_2004); CASE_GROUP(EUC_KR); CASE_GROUP(EUC_TW); CASE_GROUP(GB18030); CASE_GROUP(GBK); CASE_GROUP(JOHAB); CASE_GROUP(MULE_INTERNAL); CASE_GROUP(SJIS); CASE_GROUP(SHIFT_JIS_2004); CASE_GROUP(UHC); CASE_GROUP(UTF8); } throw pqxx::usage_error{ "Unsupported encoding group code " + to_string(int(enc)) + "."}; #undef CASE_GROUP } glyph_scanner_func *get_glyph_scanner(encoding_group enc) { return for_encoding(enc); } template struct char_finder { static std::string::size_type call( const std::string &haystack, char needle, std::string::size_type start) { const auto buffer = haystack.c_str(); const auto size = haystack.size(); for ( auto here = start; here + 1 <= size; here = glyph_scanner::call(buffer, size, here) ) { if (haystack[here] == needle) return here; } return std::string::npos; } }; template struct string_finder { static std::string::size_type call( const std::string &haystack, const std::string &needle, std::string::size_type start) { const auto buffer = haystack.c_str(); const auto size = haystack.size(); const auto needle_size = needle.size(); for ( auto here = start; here + needle_size <= size; here = glyph_scanner::call(buffer, size, here) ) { if (std::memcmp(buffer + here, needle.c_str(), needle_size) == 0) return here; } return std::string::npos; } }; std::string::size_type find_with_encoding( encoding_group enc, const std::string& haystack, char needle, std::string::size_type start ) { using finder_func = std::string::size_type( const std::string &haystack, char needle, std::string::size_type start); const auto finder = for_encoding(enc); return finder(haystack, needle, start); } std::string::size_type find_with_encoding( encoding_group enc, const std::string& haystack, const std::string& needle, std::string::size_type start ) { using finder_func = std::string::size_type( const std::string &haystack, const std::string &needle, std::string::size_type start); const auto finder = for_encoding(enc); return finder(haystack, needle, start); } #undef DISPATCH_ENCODING_OPERATION } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/src/errorhandler.cxx000066400000000000000000000017641350065432700172340ustar00rootroot00000000000000/** Implementation of pqxx::errorhandler and helpers. * * pqxx::errorhandler allows programs to receive errors and warnings. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/connection_base" #include "pqxx/errorhandler" #include "pqxx/internal/gates/connection-errorhandler.hxx" using namespace pqxx; using namespace pqxx::internal; pqxx::errorhandler::errorhandler(connection_base &conn) : m_home{&conn} { gate::connection_errorhandler{*m_home}.register_errorhandler(this); } pqxx::errorhandler::~errorhandler() { unregister(); } void pqxx::errorhandler::unregister() noexcept { if (m_home != nullptr) { gate::connection_errorhandler connection_gate{*m_home}; m_home = nullptr; connection_gate.unregister_errorhandler(this); } } libpqxx-6.4.5/src/except.cxx000066400000000000000000000042101350065432700160220ustar00rootroot00000000000000/** Implementation of libpqxx exception classes. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/except" pqxx::pqxx_exception::~pqxx_exception() noexcept { } pqxx::failure::failure(const std::string &whatarg) : std::runtime_error{whatarg} { } pqxx::broken_connection::broken_connection() : failure{"Connection to database failed"} { } pqxx::broken_connection::broken_connection(const std::string &whatarg) : failure{whatarg} { } pqxx::sql_error::sql_error( const std::string &whatarg, const std::string &Q, const char sqlstate[]) : failure{whatarg}, m_query{Q}, m_sqlstate{sqlstate ? sqlstate : ""} { } pqxx::sql_error::~sql_error() noexcept { } PQXX_PURE const std::string &pqxx::sql_error::query() const noexcept { return m_query; } PQXX_PURE const std::string &pqxx::sql_error::sqlstate() const noexcept { return m_sqlstate; } pqxx::in_doubt_error::in_doubt_error(const std::string &whatarg) : failure{whatarg} { } pqxx::transaction_rollback::transaction_rollback(const std::string &whatarg) : failure{whatarg} { } pqxx::serialization_failure::serialization_failure( const std::string &whatarg) : transaction_rollback{whatarg} { } pqxx::statement_completion_unknown::statement_completion_unknown( const std::string &whatarg) : transaction_rollback{whatarg} { } pqxx::deadlock_detected::deadlock_detected(const std::string &whatarg) : transaction_rollback{whatarg} { } pqxx::internal_error::internal_error(const std::string &whatarg) : logic_error{"libpqxx internal error: " + whatarg} { } pqxx::usage_error::usage_error(const std::string &whatarg) : logic_error{whatarg} { } pqxx::argument_error::argument_error(const std::string &whatarg) : invalid_argument{whatarg} { } pqxx::conversion_error::conversion_error(const std::string &whatarg) : domain_error{whatarg} { } pqxx::range_error::range_error(const std::string &whatarg) : out_of_range{whatarg} { } libpqxx-6.4.5/src/field.cxx000066400000000000000000000030051350065432700156160ustar00rootroot00000000000000/** Implementation of the pqxx::field class. * * pqxx::field refers to a field in a query result. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/internal/libpq-forward.hxx" #include "pqxx/result" pqxx::field::field(const pqxx::row &R, pqxx::row::size_type C) noexcept : m_col{static_cast(C)}, m_home{R.m_result}, m_row{pqxx::result_size_type(R.m_index)} { } bool pqxx::field::operator==(const field &rhs) const { if (is_null() != rhs.is_null()) return false; // TODO: Verify null handling decision const size_type s = size(); if (s != rhs.size()) return false; return std::memcmp(c_str(), rhs.c_str(), s) == 0; } const char *pqxx::field::name() const { return home().column_name(col()); } pqxx::oid pqxx::field::type() const { return home().column_type(col()); } pqxx::oid pqxx::field::table() const { return home().column_table(col()); } pqxx::row::size_type pqxx::field::table_column() const { return home().table_column(col()); } const char *pqxx::field::c_str() const { return home().GetValue(idx(), col()); } bool pqxx::field::is_null() const noexcept { return home().get_is_null(idx(), col()); } pqxx::field::size_type pqxx::field::size() const noexcept { return home().get_length(idx(), col()); } libpqxx-6.4.5/src/largeobject.cxx000066400000000000000000000153501350065432700170220ustar00rootroot00000000000000/** Implementation of the Large Objects interface. * * Allows direct access to large objects, as well as though I/O streams. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include extern "C" { #include "libpq-fe.h" } #include "pqxx/largeobject" #include "pqxx/internal/gates/connection-largeobject.hxx" using namespace pqxx::internal; namespace { inline int StdModeToPQMode(std::ios::openmode mode) { /// Mode bits, copied from libpq-fs.h so that we no longer need that header. constexpr int INV_WRITE = 0x00020000, INV_READ = 0x00040000; return ((mode & std::ios::in) ? INV_READ : 0) | ((mode & std::ios::out) ? INV_WRITE : 0); } inline int StdDirToPQDir(std::ios::seekdir dir) noexcept { // TODO: Figure out whether seekdir values match C counterparts! #ifdef PQXX_SEEKDIRS_MATCH_C return dir; #else int pqdir; switch (dir) { case std::ios::beg: pqdir=SEEK_SET; break; case std::ios::cur: pqdir=SEEK_CUR; break; case std::ios::end: pqdir=SEEK_END; break; /* Added mostly to silence compiler warning, but also to help compiler detect * cases where this function can be optimized away completely. This latter * reason should go away as soon as PQXX_SEEKDIRS_MATCH_C works. */ default: pqdir = dir; break; } return pqdir; #endif } } // namespace pqxx::largeobject::largeobject(dbtransaction &T) : m_id{} { // (Mode is ignored as of postgres 8.1.) m_id = lo_creat(raw_connection(T), 0); if (m_id == oid_none) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; throw failure{"Could not create large object: " + reason(T.conn(), err)}; } } pqxx::largeobject::largeobject(dbtransaction &T, const std::string &File) : m_id{} { m_id = lo_import(raw_connection(T), File.c_str()); if (m_id == oid_none) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; throw failure{ "Could not import file '" + File + "' to large object: " + reason(T.conn(), err)}; } } pqxx::largeobject::largeobject(const largeobjectaccess &O) noexcept : m_id{O.id()} { } void pqxx::largeobject::to_file( dbtransaction &T, const std::string &File) const { if (lo_export(raw_connection(T), id(), File.c_str()) == -1) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; throw failure{ "Could not export large object " + to_string(m_id) + " " "to file '" + File + "': " + reason(T.conn(), err)}; } } void pqxx::largeobject::remove(dbtransaction &T) const { if (lo_unlink(raw_connection(T), id()) == -1) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; throw failure{ "Could not delete large object " + to_string(m_id) + ": " + reason(T.conn(), err)}; } } pqxx::internal::pq::PGconn *pqxx::largeobject::raw_connection( const dbtransaction &T) { return gate::connection_largeobject{T.conn()}.raw_connection(); } std::string pqxx::largeobject::reason(const connection_base &c, int err) const { if (err == ENOMEM) return "Out of memory"; if (id() == oid_none) return "No object selected"; return gate::const_connection_largeobject{c}.error_message(); } pqxx::largeobjectaccess::largeobjectaccess(dbtransaction &T, openmode mode) : largeobject{T}, m_trans{T} { open(mode); } pqxx::largeobjectaccess::largeobjectaccess( dbtransaction &T, oid O, openmode mode) : largeobject{O}, m_trans{T} { open(mode); } pqxx::largeobjectaccess::largeobjectaccess( dbtransaction &T, largeobject O, openmode mode) : largeobject{O}, m_trans{T} { open(mode); } pqxx::largeobjectaccess::largeobjectaccess( dbtransaction &T, const std::string &File, openmode mode) : largeobject{T, File}, m_trans{T} { open(mode); } pqxx::largeobjectaccess::size_type pqxx::largeobjectaccess::seek(size_type dest, seekdir dir) { const auto Result = cseek(dest, dir); if (Result == -1) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; throw failure{"Error seeking in large object: " + reason(err)}; } return Result; } pqxx::largeobjectaccess::pos_type pqxx::largeobjectaccess::cseek(off_type dest, seekdir dir) noexcept { return lo_lseek(raw_connection(), m_fd, int(dest), StdDirToPQDir(dir)); } pqxx::largeobjectaccess::pos_type pqxx::largeobjectaccess::cwrite(const char Buf[], size_type Len) noexcept { return std::max( lo_write(raw_connection(), m_fd,const_cast(Buf), size_t(Len)), -1); } pqxx::largeobjectaccess::pos_type pqxx::largeobjectaccess::cread(char Buf[], size_type Bytes) noexcept { return std::max(lo_read(raw_connection(), m_fd, Buf, size_t(Bytes)), -1); } pqxx::largeobjectaccess::pos_type pqxx::largeobjectaccess::ctell() const noexcept { return lo_tell(raw_connection(), m_fd); } void pqxx::largeobjectaccess::write(const char Buf[], size_type Len) { const auto Bytes = cwrite(Buf, Len); if (Bytes < Len) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; if (Bytes < 0) throw failure{ "Error writing to large object #" + to_string(id()) + ": " + reason(err)}; if (Bytes == 0) throw failure{ "Could not write to large object #" + to_string(id()) + ": " + reason(err)}; throw failure{ "Wanted to write " + to_string(Len) + " bytes to large object #" + to_string(id()) + "; " "could only write " + to_string(Bytes)}; } } pqxx::largeobjectaccess::size_type pqxx::largeobjectaccess::read(char Buf[], size_type Len) { const auto Bytes = cread(Buf, Len); if (Bytes < 0) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; throw failure{ "Error reading from large object #" + to_string(id()) + ": " + reason(err)}; } return Bytes; } void pqxx::largeobjectaccess::open(openmode mode) { m_fd = lo_open(raw_connection(), id(), StdModeToPQMode(mode)); if (m_fd < 0) { const int err = errno; if (err == ENOMEM) throw std::bad_alloc{}; throw failure{ "Could not open large object " + to_string(id()) + ": " + reason(err)}; } } void pqxx::largeobjectaccess::close() noexcept { if (m_fd >= 0) lo_close(raw_connection(), m_fd); } pqxx::largeobjectaccess::size_type pqxx::largeobjectaccess::tell() const { const size_type res = ctell(); if (res == -1) throw failure{reason(errno)}; return res; } std::string pqxx::largeobjectaccess::reason(int err) const { if (m_fd == -1) return "No object opened."; return largeobject::reason(m_trans.conn(), err); } void pqxx::largeobjectaccess::process_notice(const std::string &s) noexcept { m_trans.process_notice(s); } libpqxx-6.4.5/src/nontransaction.cxx000066400000000000000000000011201350065432700175670ustar00rootroot00000000000000/** Implementation of the pqxx::nontransaction class. * * pqxx::nontransaction provides nontransactional database access. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/nontransaction" pqxx::nontransaction::~nontransaction() { End(); } pqxx::result pqxx::nontransaction::do_exec(const char Query[]) { return direct_exec(Query, 0); } libpqxx-6.4.5/src/notification.cxx000066400000000000000000000016151350065432700172260ustar00rootroot00000000000000/** Implementation of the pqxx::notification_receiever class. * * pqxx::notification_receiver processes notifications. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/internal/gates/connection-notification_receiver.hxx" #include "pqxx/notification" using namespace pqxx::internal; pqxx::notification_receiver::notification_receiver( connection_base &c, const std::string &channel_name) : m_conn{c}, m_channel{channel_name} { gate::connection_notification_receiver{c}.add_receiver(this); } pqxx::notification_receiver::~notification_receiver() { gate::connection_notification_receiver{this->conn()}.remove_receiver(this); } libpqxx-6.4.5/src/pipeline.cxx000066400000000000000000000241451350065432700163500ustar00rootroot00000000000000/** Implementation of the pqxx::pipeline class. * * Throughput-optimized query interface. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/dbtransaction" #include "pqxx/pipeline" #include "pqxx/internal/gates/connection-pipeline.hxx" #include "pqxx/internal/gates/result-creation.hxx" using namespace pqxx; using namespace pqxx::internal; namespace { const std::string theSeparator{"; "}; const std::string theDummyValue{"1"}; const std::string theDummyQuery{"SELECT " + theDummyValue + theSeparator}; } pqxx::pipeline::pipeline(transaction_base &t, const std::string &Name) : namedclass{"pipeline", Name}, transactionfocus{t} { m_issuedrange = make_pair(m_queries.end(), m_queries.end()); attach(); } pqxx::pipeline::~pipeline() noexcept { try { cancel(); } catch (const std::exception &) {} detach(); } void pqxx::pipeline::attach() { if (not registered()) register_me(); } void pqxx::pipeline::detach() { if (registered()) unregister_me(); } pipeline::query_id pqxx::pipeline::insert(const std::string &q) { attach(); const query_id qid = generate_id(); const auto i = m_queries.insert(std::make_pair(qid,Query(q))).first; if (m_issuedrange.second == m_queries.end()) { m_issuedrange.second = i; if (m_issuedrange.first == m_queries.end()) m_issuedrange.first = i; } m_num_waiting++; if (m_num_waiting > m_retain) { if (have_pending()) receive_if_available(); if (not have_pending()) issue(); } return qid; } void pqxx::pipeline::complete() { if (have_pending()) receive(m_issuedrange.second); if (m_num_waiting and (m_error == qid_limit())) { issue(); receive(m_queries.end()); } detach(); } void pqxx::pipeline::flush() { if (not m_queries.empty()) { if (have_pending()) receive(m_issuedrange.second); m_issuedrange.first = m_issuedrange.second = m_queries.end(); m_num_waiting = 0; m_dummy_pending = false; m_queries.clear(); } detach(); } void pqxx::pipeline::cancel() { while (have_pending()) { gate::connection_pipeline(m_trans.conn()).cancel_query(); auto canceled_query = m_issuedrange.first; ++m_issuedrange.first; m_queries.erase(canceled_query); } } bool pqxx::pipeline::is_finished(pipeline::query_id q) const { if (m_queries.find(q) == m_queries.end()) throw std::logic_error{ "Requested status for unknown query '" + to_string(q) + "'."}; return (QueryMap::const_iterator(m_issuedrange.first)==m_queries.end()) or (q < m_issuedrange.first->first and q < m_error); } std::pair pqxx::pipeline::retrieve() { if (m_queries.empty()) throw std::logic_error{"Attempt to retrieve result from empty pipeline."}; return retrieve(std::begin(m_queries)); } int pqxx::pipeline::retain(int retain_max) { if (retain_max < 0) throw range_error{ "Attempt to make pipeline retain " + to_string(retain_max) + " queries"}; const int oldvalue = m_retain; m_retain = retain_max; if (m_num_waiting >= m_retain) resume(); return oldvalue; } void pqxx::pipeline::resume() { if (have_pending()) receive_if_available(); if (not have_pending() and m_num_waiting) { issue(); receive_if_available(); } } pipeline::query_id pqxx::pipeline::generate_id() { if (m_q_id == qid_limit()) throw std::overflow_error{"Too many queries went through pipeline."}; ++m_q_id; return m_q_id; } void pqxx::pipeline::issue() { // TODO: Wrap in nested transaction if available, for extra "replayability" // Retrieve that null result for the last query, if needed obtain_result(); // Don't issue anything if we've encountered an error if (m_error < qid_limit()) return; // Start with oldest query (lowest id) not in previous issue range auto oldest = m_issuedrange.second; // Construct cumulative query string for entire batch std::string cum = separated_list( theSeparator, oldest, m_queries.end(), [](QueryMap::const_iterator i){return i->second.get_query();}); const auto num_issued = QueryMap::size_type(std::distance( oldest, m_queries.end())); const bool prepend_dummy = (num_issued > 1); if (prepend_dummy) cum = theDummyQuery + cum; gate::connection_pipeline{m_trans.conn()}.start_exec(cum); // Since we managed to send out these queries, update state to reflect this m_dummy_pending = prepend_dummy; m_issuedrange.first = oldest; m_issuedrange.second = m_queries.end(); m_num_waiting -= int(num_issued); } void pqxx::pipeline::internal_error(const std::string &err) { set_error_at(0); throw pqxx::internal_error{err}; } bool pqxx::pipeline::obtain_result(bool expect_none) { gate::connection_pipeline gate{m_trans.conn()}; const auto r = gate.get_result(); if (r == nullptr) { if (have_pending() and not expect_none) { set_error_at(m_issuedrange.first->first); m_issuedrange.second = m_issuedrange.first; } return false; } const result res = gate::result_creation::create( r, std::begin(m_queries)->second.get_query(), internal::enc_group(m_trans.conn().encoding_id())); if (not have_pending()) { set_error_at(std::begin(m_queries)->first); throw std::logic_error{ "Got more results from pipeline than there were queries."}; } // Must be the result for the oldest pending query if (not m_issuedrange.first->second.get_result().empty()) internal_error("Multiple results for one query."); m_issuedrange.first->second.set_result(res); ++m_issuedrange.first; return true; } void pqxx::pipeline::obtain_dummy() { gate::connection_pipeline gate{m_trans.conn()}; const auto r = gate.get_result(); m_dummy_pending = false; if (r == nullptr) internal_error("Pipeline got no result from backend when it expected one."); result R = gate::result_creation::create( r, "[DUMMY PIPELINE QUERY]", internal::enc_group(m_trans.conn().encoding_id())); bool OK = false; try { gate::result_creation{R}.check_status(); OK = true; } catch (const sql_error &) { } if (OK) { if (R.size() > 1) internal_error("Unexpected result for dummy query in pipeline."); if (std::string{R.at(0).at(0).c_str()} != theDummyValue) internal_error("Dummy query in pipeline returned unexpected value."); return; } /* Since none of the queries in the batch were actually executed, we can * afford to replay them one by one until we find the exact query that * caused the error. This gives us not only a more specific error message * to report, but also tells us which query to report it for. */ // First, give the whole batch the same syntax error message, in case all else // is going to fail. for (auto i = m_issuedrange.first; i != m_issuedrange.second; ++i) i->second.set_result(R); // Remember where the end of this batch was const auto stop = m_issuedrange.second; // Retrieve that null result for the last query, if needed obtain_result(true); // Reset internal state to forget botched batch attempt m_num_waiting += int(std::distance(m_issuedrange.first, stop)); m_issuedrange.second = m_issuedrange.first; // Issue queries in failed batch one at a time. unregister_me(); try { do { m_num_waiting--; const std::string &query = m_issuedrange.first->second.get_query(); const result res{m_trans.exec(query)}; m_issuedrange.first->second.set_result(res); gate::result_creation{res}.check_status(); ++m_issuedrange.first; } while (m_issuedrange.first != stop); } catch (const std::exception &) { const query_id thud = m_issuedrange.first->first; ++m_issuedrange.first; m_issuedrange.second = m_issuedrange.first; auto q = m_issuedrange.first; set_error_at( (q == m_queries.end()) ? thud + 1 : q->first); } } std::pair pqxx::pipeline::retrieve(pipeline::QueryMap::iterator q) { if (q == m_queries.end()) throw std::logic_error{"Attempt to retrieve result for unknown query."}; if (q->first >= m_error) throw std::runtime_error{ "Could not complete query in pipeline due to error in earlier query."}; // If query hasn't issued yet, do it now if (m_issuedrange.second != m_queries.end() and (q->first >= m_issuedrange.second->first)) { if (have_pending()) receive(m_issuedrange.second); if (m_error == qid_limit()) issue(); } // If result not in yet, get it; else get at least whatever's convenient if (have_pending()) { if (q->first >= m_issuedrange.first->first) { auto suc = q; ++suc; receive(suc); } else { receive_if_available(); } } if (q->first >= m_error) throw std::runtime_error{ "Could not complete query in pipeline due to error in earlier query."}; // Don't leave the backend idle if there are queries waiting to be issued if (m_num_waiting and not have_pending() and (m_error==qid_limit())) issue(); const result R = q->second.get_result(); const auto P = std::make_pair(q->first, R); m_queries.erase(q); gate::result_creation{R}.check_status(); return P; } void pqxx::pipeline::get_further_available_results() { gate::connection_pipeline gate{m_trans.conn()}; while (not gate.is_busy() and obtain_result()) if (not gate.consume_input()) throw broken_connection{}; } void pqxx::pipeline::receive_if_available() { gate::connection_pipeline gate{m_trans.conn()}; if (not gate.consume_input()) throw broken_connection{}; if (gate.is_busy()) return; if (m_dummy_pending) obtain_dummy(); if (have_pending()) get_further_available_results(); } void pqxx::pipeline::receive(pipeline::QueryMap::const_iterator stop) { if (m_dummy_pending) obtain_dummy(); while (obtain_result() and QueryMap::const_iterator{m_issuedrange.first} != stop) ; // Also haul in any remaining "targets of opportunity" if (QueryMap::const_iterator{m_issuedrange.first} == stop) get_further_available_results(); } libpqxx-6.4.5/src/prepared_statement.cxx000066400000000000000000000025721350065432700204310ustar00rootroot00000000000000/** Helper classes for defining and executing prepared statements> * * See the connection_base hierarchy for more about prepared statements. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/connection_base" #include "pqxx/prepared_statement" #include "pqxx/result" #include "pqxx/transaction_base" #include "pqxx/internal/gates/connection-prepare-invocation.hxx" using namespace pqxx; using namespace pqxx::internal; pqxx::prepare::invocation::invocation( transaction_base &home, const std::string &statement) : m_home{home}, m_statement{statement} { } pqxx::result pqxx::prepare::invocation::exec() const { std::vector ptrs; std::vector lens; std::vector binaries; const int elts = marshall(ptrs, lens, binaries); return gate::connection_prepare_invocation{m_home.conn()}.prepared_exec( m_statement, ptrs.data(), lens.data(), binaries.data(), elts); } bool pqxx::prepare::invocation::exists() const { return gate::connection_prepare_invocation{m_home.conn()}.prepared_exists( m_statement); } pqxx::prepare::internal::prepared_def::prepared_def(const std::string &def) : definition{def} { } libpqxx-6.4.5/src/result.cxx000066400000000000000000000253221350065432700160570ustar00rootroot00000000000000/** Implementation of the pqxx::result class and support classes. * * pqxx::result represents the set of result rows from a database query * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include extern "C" { #include "libpq-fe.h" } #include "pqxx/except" #include "pqxx/result" const std::string pqxx::result::s_empty_string; /// C++ wrapper for libpq's PQclear. void pqxx::internal::clear_result(const pq::PGresult *data) { PQclear(const_cast(data)); } pqxx::result::result( pqxx::internal::pq::PGresult *rhs, const std::string &Query, internal::encoding_group enc) : m_data{make_data_pointer(rhs)}, m_query{std::make_shared(Query)}, m_encoding(enc) { } bool pqxx::result::operator==(const result &rhs) const noexcept { if (&rhs == this) return true; const auto s = size(); if (rhs.size() != s) return false; for (size_type i=0; i= size()) throw range_error{"Row number out of range."}; return operator[](i); } namespace { /// C string comparison. inline bool equal(const char lhs[], const char rhs[]) { return strcmp(lhs, rhs) == 0; } } // namespace void pqxx::result::ThrowSQLError( const std::string &Err, const std::string &Query) const { // Try to establish more precise error type, and throw corresponding // type of exception. const char *const code = PQresultErrorField(m_data.get(), PG_DIAG_SQLSTATE); if (code) switch (code[0]) { case '0': switch (code[1]) { case '8': throw broken_connection{Err}; case 'A': throw feature_not_supported{Err, Query, code}; } break; case '2': switch (code[1]) { case '2': throw data_exception{Err, Query, code}; case '3': if (equal(code,"23001")) throw restrict_violation{Err, Query, code}; if (equal(code,"23502")) throw not_null_violation{Err, Query, code}; if (equal(code,"23503")) throw foreign_key_violation{Err, Query, code}; if (equal(code,"23505")) throw unique_violation{Err, Query, code}; if (equal(code,"23514")) throw check_violation{Err, Query, code}; throw integrity_constraint_violation{Err, Query, code}; case '4': throw invalid_cursor_state{Err, Query, code}; case '6': throw invalid_sql_statement_name{Err, Query, code}; } break; case '3': switch (code[1]) { case '4': throw invalid_cursor_name{Err, Query, code}; } break; case '4': switch (code[1]) { case '0': if (equal(code, "40000")) throw transaction_rollback{Err}; if (equal(code, "40001")) throw serialization_failure{Err}; if (equal(code, "40003")) throw statement_completion_unknown{Err}; if (equal(code, "40P01")) throw deadlock_detected{Err}; break; case '2': if (equal(code,"42501")) throw insufficient_privilege{Err, Query}; if (equal(code,"42601")) throw syntax_error{Err, Query, code, errorposition()}; if (equal(code,"42703")) throw undefined_column{Err, Query, code}; if (equal(code,"42883")) throw undefined_function{Err, Query, code}; if (equal(code,"42P01")) throw undefined_table{Err, Query, code}; } break; case '5': switch (code[1]) { case '3': if (equal(code,"53100")) throw disk_full{Err, Query, code}; if (equal(code,"53200")) throw out_of_memory{Err, Query, code}; if (equal(code,"53300")) throw too_many_connections{Err}; throw insufficient_resources{Err, Query, code}; } break; case 'P': if (equal(code, "P0001")) throw plpgsql_raise{Err, Query, code}; if (equal(code, "P0002")) throw plpgsql_no_data_found{Err, Query, code}; if (equal(code, "P0003")) throw plpgsql_too_many_rows{Err, Query, code}; throw plpgsql_error{Err, Query, code}; } // Fallback: No error code. throw sql_error{Err, Query, code}; } void pqxx::result::check_status() const { const std::string Err = StatusError(); if (not Err.empty()) ThrowSQLError(Err, query()); } std::string pqxx::result::StatusError() const { if (m_data.get() == nullptr) throw failure{"No result set given."}; std::string Err; switch (PQresultStatus(m_data.get())) { case PGRES_EMPTY_QUERY: // The string sent to the backend was empty. case PGRES_COMMAND_OK: // Successful completion of a command returning no data case PGRES_TUPLES_OK: // The query successfully executed break; case PGRES_COPY_OUT: // Copy Out (from server) data transfer started case PGRES_COPY_IN: // Copy In (to server) data transfer started break; case PGRES_BAD_RESPONSE: // The server's response was not understood case PGRES_NONFATAL_ERROR: case PGRES_FATAL_ERROR: Err = PQresultErrorMessage(m_data.get()); break; default: throw internal_error{ "pqxx::result: Unrecognized response code " + to_string(int(PQresultStatus(m_data.get())))}; } return Err; } const char *pqxx::result::cmd_status() const noexcept { return PQcmdStatus(const_cast(m_data.get())); } const std::string &pqxx::result::query() const noexcept { return m_query ? *m_query : s_empty_string; } pqxx::oid pqxx::result::inserted_oid() const { if (m_data.get() == nullptr) throw usage_error{ "Attempt to read oid of inserted row without an INSERT result"}; return PQoidValue(const_cast(m_data.get())); } pqxx::result::size_type pqxx::result::affected_rows() const { const char *const RowsStr = PQcmdTuples( const_cast(m_data.get())); return RowsStr[0] ? size_type(atoi(RowsStr)) : 0; } const char *pqxx::result::GetValue( pqxx::result::size_type Row, pqxx::row::size_type Col) const { return PQgetvalue(m_data.get(), int(Row), int(Col)); } bool pqxx::result::get_is_null( pqxx::result::size_type Row, pqxx::row::size_type Col) const { return PQgetisnull(m_data.get(), int(Row), int(Col)) != 0; } pqxx::field::size_type pqxx::result::get_length( pqxx::result::size_type Row, pqxx::row::size_type Col) const noexcept { return field::size_type(PQgetlength(m_data.get(), int(Row), int(Col))); } pqxx::oid pqxx::result::column_type(row::size_type ColNum) const { const oid T = PQftype(m_data.get(), int(ColNum)); if (T == oid_none) throw argument_error{ "Attempt to retrieve type of nonexistent column " + to_string(ColNum) + " of query result."}; return T; } pqxx::oid pqxx::result::column_table(row::size_type ColNum) const { const oid T = PQftable(m_data.get(), int(ColNum)); /* If we get oid_none, it may be because the column is computed, or because we * got an invalid row number. */ if (T == oid_none and ColNum >= columns()) throw argument_error{ "Attempt to retrieve table ID for column " + to_string(ColNum) + " out of " + to_string(columns())}; return T; } pqxx::row::size_type pqxx::result::table_column(row::size_type ColNum) const { const auto n = row::size_type(PQftablecol(m_data.get(), int(ColNum))); if (n != 0) return n-1; // Failed. Now find out why, so we can throw a sensible exception. const std::string col_num = to_string(ColNum); if (ColNum > columns()) throw range_error{"Invalid column index in table_column(): " + col_num}; if (m_data.get() == nullptr) throw usage_error{ "Can't query origin of column " + col_num + ": " "result is not initialized."}; throw usage_error{ "Can't query origin of column " + col_num + ": " "not derived from table column."}; } int pqxx::result::errorposition() const { int pos = -1; if (m_data.get()) { const char *p = PQresultErrorField( const_cast(m_data.get()), PG_DIAG_STATEMENT_POSITION); if (p) from_string(p, pos); } return pos; } const char *pqxx::result::column_name(pqxx::row::size_type Number) const { const char *const N = PQfname(m_data.get(), int(Number)); if (N == nullptr) { if (m_data.get() == nullptr) throw usage_error{"Queried column name on null result."}; throw range_error{ "Invalid column number: " + to_string(Number) + " (maximum is " + to_string(columns() - 1) + ")."}; } return N; } pqxx::row::size_type pqxx::result::columns() const noexcept { auto ptr = const_cast(m_data.get()); return ptr ? row::size_type(PQnfields(ptr)) : 0; } // const_result_iterator pqxx::const_result_iterator pqxx::const_result_iterator::operator++(int) { const_result_iterator old{*this}; m_index++; return old; } pqxx::const_result_iterator pqxx::const_result_iterator::operator--(int) { const_result_iterator old{*this}; m_index--; return old; } pqxx::result::const_iterator pqxx::result::const_reverse_iterator::base() const noexcept { iterator_type tmp{*this}; return ++tmp; } pqxx::const_reverse_result_iterator pqxx::const_reverse_result_iterator::operator++(int) { const_reverse_result_iterator tmp{*this}; iterator_type::operator--(); return tmp; } pqxx::const_reverse_result_iterator pqxx::const_reverse_result_iterator::operator--(int) { const_reverse_result_iterator tmp{*this}; iterator_type::operator++(); return tmp; } template<> std::string pqxx::to_string(const field &Obj) { return std::string{Obj.c_str(), Obj.size()}; } libpqxx-6.4.5/src/robusttransaction.cxx000066400000000000000000000206071350065432700203260ustar00rootroot00000000000000/** Implementation of the pqxx::robusttransaction class. * * pqxx::robusttransaction is a slower but safer transaction class. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/connection_base" #include "pqxx/result" #include "pqxx/robusttransaction" using namespace pqxx::internal; // TODO: Log username in more places. pqxx::internal::basic_robusttransaction::basic_robusttransaction( connection_base &C, const std::string &IsolationLevel, const std::string &table_name) : namedclass{"robusttransaction"}, dbtransaction(C, IsolationLevel), m_log_table{table_name} { if (table_name.empty()) m_log_table = "pqxx_robusttransaction_log"; m_sequence = m_log_table + "_seq"; } pqxx::internal::basic_robusttransaction::~basic_robusttransaction() { } void pqxx::internal::basic_robusttransaction::do_begin() { try { CreateTransactionRecord(); } catch (const std::exception &) { // The problem here *may* be that the log table doesn't exist yet. Create // one, start a new transaction, and try again. try { dbtransaction::do_abort(); } catch (const std::exception &) {} CreateLogTable(); dbtransaction::do_begin(); m_backendpid = conn().backendpid(); CreateTransactionRecord(); } dbtransaction::do_begin(); // If this transaction commits, the transaction record should also be gone. direct_exec(sql_delete().c_str()); if (conn().server_version() >= 80300) direct_exec("SELECT txid_current()")[0][0].to(m_xid); } void pqxx::internal::basic_robusttransaction::do_commit() { if (m_record_id == 0) throw internal_error{"transaction '" + name() + "' has no ID."}; // Check constraints before sending the COMMIT to the database to reduce the // work being done inside our in-doubt window. try { direct_exec("SET CONSTRAINTS ALL IMMEDIATE"); } catch (...) { do_abort(); throw; } // Here comes the critical part. If we lose our connection here, we'll be // left clueless as to whether the backend got the message and is trying to // commit the transaction (let alone whether it will succeed if so). That // case requires some special handling that makes robusttransaction what it // is. try { direct_exec("COMMIT"); // If we make it here, great. Normal, successful commit. m_record_id = 0; return; } catch (const broken_connection &) { // Oops, lost connection at the crucial moment. Fall through to in-doubt // handling below. } catch (...) { if (conn().is_open()) { // Commit failed--probably due to a constraint violation or something // similar. But we're still connected, so no worries from a consistency // point of view. do_abort(); throw; } // Otherwise, fall through to in-doubt handling. } // If we get here, we're in doubt. Talk to the backend, figure out what // happened. If the transaction record still exists, the transaction failed. // If not, it succeeded. bool exists; try { exists = CheckTransactionRecord(); } catch (const std::exception &f) { // Couldn't check for transaction record. We're still in doubt as to // whether the transaction was performed. const std::string Msg = "WARNING: Connection lost while committing transaction " "'" + name() + "' (id " + to_string(m_record_id) + ", " "transaction_id " + m_xid + "). " "Please check for this record in the " "'" + m_log_table + "' table. " "If the record exists, the transaction was executed. " "If not, then it wasn't.\n"; process_notice(Msg); process_notice( "Could not verify existence of transaction record because of the " "following error:\n"); process_notice(std::string{f.what()} + "\n"); throw in_doubt_error{Msg}; } // Transaction record is still there, so the transaction failed and all we // have is a "normal" transaction failure. if (exists) { do_abort(); throw broken_connection{"Connection lost while committing."}; } // Otherwise, the transaction succeeded. Forget there was ever an error. } void pqxx::internal::basic_robusttransaction::do_abort() { dbtransaction::do_abort(); DeleteTransactionRecord(); } // Create transaction log table if it didn't already exist void pqxx::internal::basic_robusttransaction::CreateLogTable() { // Create log table in case it doesn't already exist. This code must only be // executed before the backend transaction has properly started. std::string CrTab = "CREATE TABLE " + quote_name(m_log_table) + " (" "id INTEGER NOT NULL, " "username VARCHAR(256), " "transaction_id xid, " "name VARCHAR(256), " "date TIMESTAMP NOT NULL" ")"; try { direct_exec(CrTab.c_str(), 1); } catch (const std::exception &e) { conn().process_notice( "Could not create transaction log table: " + std::string{e.what()}); } try { direct_exec(("CREATE SEQUENCE " + m_sequence).c_str()); } catch (const std::exception &e) { conn().process_notice( "Could not create transaction log sequence: " + std::string{e.what()}); } } void pqxx::internal::basic_robusttransaction::CreateTransactionRecord() { // Clean up old transaction records. direct_exec(( "DELETE FROM " + m_log_table + " " "WHERE date < CURRENT_TIMESTAMP - '30 days'::interval").c_str()); // Allocate id. const std::string sql_get_id{"SELECT nextval(" + quote(m_sequence) + ")"}; direct_exec(sql_get_id.c_str())[0][0].to(m_record_id); direct_exec(( "INSERT INTO " + quote_name(m_log_table) + " (id, username, name, date) " "VALUES " "(" + to_string(m_record_id) + ", " + quote(conn().username()) + ", " + (name().empty() ? "NULL" : quote(name())) + ", " "CURRENT_TIMESTAMP" ")").c_str()); } std::string pqxx::internal::basic_robusttransaction::sql_delete() const { return "DELETE FROM " + quote_name(m_log_table) + " " "WHERE id = " + to_string(m_record_id); } void pqxx::internal::basic_robusttransaction::DeleteTransactionRecord() noexcept { if (m_record_id == 0) return; try { const std::string Del = sql_delete(); reactivation_avoidance_exemption E(conn()); direct_exec(Del.c_str(), 20); // Now that we've arrived here, we're about as sure as we can be that that // record is quite dead. m_record_id = 0; } catch (const std::exception &) { } if (m_record_id != 0) try { process_notice( "WARNING: " "Failed to delete obsolete transaction record with id " + to_string(m_record_id) + " ('" + name() + "'). " "Please delete it manually. Thank you.\n"); } catch (const std::exception &) { } } // Attempt to establish whether transaction record with given ID still exists bool pqxx::internal::basic_robusttransaction::CheckTransactionRecord() { bool hold = true; for (int c=20; hold and c; internal::sleep_seconds(5), --c) { if (conn().server_version() > 80300) { const std::string query{ "SELECT " + m_xid + " >= txid_snapshot_xmin(txid_current_snapshot())"}; direct_exec(query.c_str())[0][0].to(hold); } else { /* Wait for the old backend (with the lost connection) to die. * * Actually this is only possible if stats_command_string (or maybe * stats_start_collector?) has been set in postgresql.conf and we're * running as the postgres superuser. * * Starting with 7.4, we could also use pg_locks. The entry for a zombied * transaction will have a "relation" field of null, a "transaction" field * with the transaction ID, and "pid" set to our backend pid. If the * relation exists but no such record is found, then the transaction is no * longer running. */ const result R{direct_exec(( "SELECT current_query " "FROM pq_stat_activity " "WHERE procpid = " + to_string(m_backendpid)).c_str())}; hold = not R.empty(); } } if (hold) throw in_doubt_error{ "Old backend process stays alive too long to wait for."}; // Now look for our transaction record const std::string Find = "SELECT id FROM " + quote_name(m_log_table) + " " "WHERE " "id = " + to_string(m_record_id) + " AND " "user = " + conn().username(); return not direct_exec(Find.c_str(), 20).empty(); } libpqxx-6.4.5/src/row.cxx000066400000000000000000000122271350065432700153500ustar00rootroot00000000000000/** Implementation of the pqxx::result class and support classes. * * pqxx::result represents the set of result rows from a database query. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include extern "C" { #include "libpq-fe.h" } #include "pqxx/except" #include "pqxx/result" #include "pqxx/internal/gates/result-row.hxx" pqxx::row::row(result r, size_t i) noexcept : m_result{r}, m_index{long(i)}, m_end{internal::gate::result_row(r) ? r.columns() : 0} { } pqxx::row::const_iterator pqxx::row::begin() const noexcept { return const_iterator{*this, m_begin}; } pqxx::row::const_iterator pqxx::row::cbegin() const noexcept { return begin(); } pqxx::row::const_iterator pqxx::row::end() const noexcept { return const_iterator{*this, m_end}; } pqxx::row::const_iterator pqxx::row::cend() const noexcept { return end(); } pqxx::row::reference pqxx::row::front() const noexcept { return field{*this, m_begin}; } pqxx::row::reference pqxx::row::back() const noexcept { return field{*this, m_end - 1}; } pqxx::row::const_reverse_iterator pqxx::row::rbegin() const { return const_reverse_row_iterator{end()}; } pqxx::row::const_reverse_iterator pqxx::row::crbegin() const { return rbegin(); } pqxx::row::const_reverse_iterator pqxx::row::rend() const { return const_reverse_row_iterator{begin()}; } pqxx::row::const_reverse_iterator pqxx::row::crend() const { return rend(); } bool pqxx::row::operator==(const row &rhs) const noexcept { if (&rhs == this) return true; const auto s = size(); if (rhs.size() != s) return false; // TODO: Depends on how null is handled! for (size_type i=0; i= size()) throw range_error{"Invalid field number."}; return operator[](i); } pqxx::oid pqxx::row::column_type(size_type ColNum) const { return m_result.column_type(m_begin + ColNum); } pqxx::oid pqxx::row::column_table(size_type ColNum) const { return m_result.column_table(m_begin + ColNum); } pqxx::row::size_type pqxx::row::table_column(size_type ColNum) const { return m_result.table_column(m_begin + ColNum); } pqxx::row::size_type pqxx::row::column_number(const char ColName[]) const { const auto n = m_result.column_number(ColName); if (n >= m_end) return result{}.column_number(ColName); if (n >= m_begin) return n - m_begin; const char *const AdaptedColName = m_result.column_name(n); for (auto i = m_begin; i < m_end; ++i) if (strcmp(AdaptedColName, m_result.column_name(i)) == 0) return i - m_begin; return result{}.column_number(ColName); } pqxx::row::size_type pqxx::result::column_number(const char ColName[]) const { const int N = PQfnumber( const_cast(m_data.get()), ColName); if (N == -1) throw argument_error{ "Unknown column name: '" + std::string{ColName} + "'."}; return row::size_type(N); } pqxx::row pqxx::row::slice(size_type Begin, size_type End) const { if (Begin > End or End > size()) throw range_error{"Invalid field range."}; row result{*this}; result.m_begin = m_begin + Begin; result.m_end = m_begin + End; return result; } bool pqxx::row::empty() const noexcept { return m_begin == m_end; } pqxx::const_row_iterator pqxx::const_row_iterator::operator++(int) { const_row_iterator old{*this}; m_col++; return old; } pqxx::const_row_iterator pqxx::const_row_iterator::operator--(int) { const_row_iterator old{*this}; m_col--; return old; } pqxx::const_row_iterator pqxx::const_reverse_row_iterator::base() const noexcept { iterator_type tmp{*this}; return ++tmp; } pqxx::const_reverse_row_iterator pqxx::const_reverse_row_iterator::operator++(int) { const_reverse_row_iterator tmp{*this}; operator++(); return tmp; } pqxx::const_reverse_row_iterator pqxx::const_reverse_row_iterator::operator--(int) { const_reverse_row_iterator tmp{*this}; operator--(); return tmp; } libpqxx-6.4.5/src/sql_cursor.cxx000066400000000000000000000220311350065432700167270ustar00rootroot00000000000000/** Implementation of libpqxx STL-style cursor classes. * * These classes wrap SQL cursors in STL-like interfaces. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/cursor" #include "pqxx/internal/encodings.hxx" #include "pqxx/internal/gates/connection-sql_cursor.hxx" #include "pqxx/internal/gates/transaction-sql_cursor.hxx" using namespace pqxx; using namespace pqxx::internal; namespace { /// Is this character a "useless trailing character" in a query? /** A character is "useless" at the end of a query if it is either whitespace or * a semicolon. */ inline bool useless_trail(char c) { return isspace(c) or c==';'; } /// Find end of nonempty query, stripping off any trailing semicolon. /** When executing a normal query, a trailing semicolon is meaningless but * won't hurt. That's why we can't rule out that some code may include one. * * But for cursor queries, a trailing semicolon is a problem. The query gets * embedded in a larger statement, which a semicolon would break into two. * We'll have to remove it if present. * * A trailing semicolon may not actually be at the end. It could be masked by * subsequent whitespace. If there's also a comment though, that's the * caller's own lookout. We can't guard against every possible mistake, and * text processing is actually remarkably sensitive to mistakes in a * multi-encoding world. * * If there is a trailing semicolon, this function returns its offset. If * there are more than one, it returns the offset of the first one. If there * is no trailing semicolon, it returns the length of the query string. * * The query must be nonempty. */ std::string::size_type find_query_end( const std::string &query, encoding_group enc) { const auto text = query.c_str(); const auto size = query.size(); std::string::size_type end; if (enc == encoding_group::MONOBYTE) { // This is an encoding where we can scan backwards from the end. for (end = query.size(); end > 0 and useless_trail(text[end-1]); --end); } else { // Complex encoding. We only know how to iterate forwards, so start from // the beginning. end = 0; pqxx::internal::for_glyphs( enc, [text, &end](const char *gbegin, const char *gend) { if (gend - gbegin > 1 or not useless_trail(*gbegin)) end = std::string::size_type(gend - text); }, text, size); } return end; } } // namespace pqxx::internal::sql_cursor::sql_cursor( transaction_base &t, const std::string &query, const std::string &cname, cursor_base::accesspolicy ap, cursor_base::updatepolicy up, cursor_base::ownershippolicy op, bool hold) : cursor_base{t.conn(), cname}, m_home{t.conn()}, m_adopted{false}, m_at_end{-1}, m_pos{0} { if (&t.conn() != &m_home) throw internal_error{"Cursor in wrong connection"}; #include "pqxx/internal/ignore-deprecated-pre.hxx" m_home.activate(); #include "pqxx/internal/ignore-deprecated-post.hxx" if (query.empty()) throw usage_error{"Cursor has empty query."}; const auto enc = enc_group(t.conn().encoding_id()); const auto qend = find_query_end(query, enc); if (qend == 0) throw usage_error{"Cursor has effectively empty query."}; std::stringstream cq, qn; cq << "DECLARE " << t.quote_name(name()) << " "; if (ap == cursor_base::forward_only) cq << "NO "; cq << "SCROLL "; cq << "CURSOR "; if (hold) cq << "WITH HOLD "; cq << "FOR "; cq.write(query.c_str(), std::streamsize(qend)); cq << ' '; if (up != cursor_base::update) cq << "FOR READ ONLY "; else cq << "FOR UPDATE "; qn << "[DECLARE " << name() << ']'; t.exec(cq, qn.str()); // Now that we're here in the starting position, keep a copy of an empty // result. That may come in handy later, because we may not be able to // construct an empty result with all the right metadata due to the weird // meaning of "FETCH 0." init_empty_result(t); // If we're creating a WITH HOLD cursor, noone is going to destroy it until // after this transaction. That means the connection cannot be deactivated // without losing the cursor. if (hold) gate::connection_sql_cursor{t.conn()}.add_reactivation_avoidance_count(1); m_ownership = op; } pqxx::internal::sql_cursor::sql_cursor( transaction_base &t, const std::string &cname, cursor_base::ownershippolicy op) : cursor_base{t.conn(), cname, false}, m_home{t.conn()}, m_empty_result{}, m_adopted{true}, m_at_end{0}, m_pos{-1} { // If we take responsibility for destroying the cursor, that's one less // reason not to allow the connection to be deactivated and reactivated. // TODO: Go over lifetime/reactivation rules again to be sure they work. if (op==cursor_base::owned) gate::connection_sql_cursor{t.conn()}.add_reactivation_avoidance_count(-1); m_adopted = true; m_ownership = op; } void pqxx::internal::sql_cursor::close() noexcept { if (m_ownership==cursor_base::owned) { try { gate::connection_sql_cursor{m_home}.exec( ("CLOSE " + m_home.quote_name(name())).c_str(), 0); } catch (const std::exception &) { } if (m_adopted) gate::connection_sql_cursor{m_home}.add_reactivation_avoidance_count(-1); m_ownership = cursor_base::loose; } } void pqxx::internal::sql_cursor::init_empty_result(transaction_base &t) { if (pos() != 0) throw internal_error{"init_empty_result() from bad pos()."}; m_empty_result = t.exec("FETCH 0 IN " + m_home.quote_name(name())); } /// Compute actual displacement based on requested and reported displacements. internal::sql_cursor::difference_type pqxx::internal::sql_cursor::adjust(difference_type hoped, difference_type actual) { if (actual < 0) throw internal_error{"Negative rows in cursor movement."}; if (hoped == 0) return 0; const int direction = ((hoped < 0) ? -1 : 1); bool hit_end = false; if (actual != labs(hoped)) { if (actual > labs(hoped)) throw internal_error{"Cursor displacement larger than requested."}; // If we see fewer rows than requested, then we've hit an end (on either // side) of the result set. Wether we make an extra step to a one-past-end // position or whether we're already there depends on where we were // previously: if our last move was in the same direction and also fell // short, we're already at a one-past-end row. if (m_at_end != direction) ++actual; // If we hit the beginning, make sure our position calculation ends up // at zero (even if we didn't previously know where we were!), and if we // hit the other end, register the fact that we now know where the end // of the result set is. if (direction > 0) hit_end = true; else if (m_pos == -1) m_pos = actual; else if (m_pos != actual) throw internal_error{ "Moved back to beginning, but wrong position: " "hoped=" + to_string(hoped) + ", " "actual=" + to_string(actual) + ", " "m_pos=" + to_string(m_pos) + ", " "direction=" + to_string(direction) + "."}; m_at_end = direction; } else { m_at_end = 0; } if (m_pos >= 0) m_pos += direction*actual; if (hit_end) { if (m_endpos >= 0 and m_pos != m_endpos) throw internal_error{"Inconsistent cursor end positions."}; m_endpos = m_pos; } return direction*actual; } result pqxx::internal::sql_cursor::fetch( difference_type rows, difference_type &displacement) { if (rows == 0) { displacement = 0; return m_empty_result; } const std::string query = "FETCH " + stridestring(rows) + " IN " + m_home.quote_name(name()); const result r{gate::connection_sql_cursor{m_home}.exec(query.c_str(), 0)}; displacement = adjust(rows, difference_type(r.size())); return r; } cursor_base::difference_type pqxx::internal::sql_cursor::move( difference_type rows, difference_type &displacement) { if (rows == 0) { displacement = 0; return 0; } const std::string query = "MOVE " + stridestring(rows) + " IN " + m_home.quote_name(name()); const result r(gate::connection_sql_cursor{m_home}.exec(query.c_str(), 0)); difference_type d = difference_type(r.affected_rows()); displacement = adjust(rows, d); return d; } std::string pqxx::internal::sql_cursor::stridestring(difference_type n) { /* Some special-casing for ALL and BACKWARD ALL here. We used to use numeric * "infinities" for difference_type for this (the highest and lowest possible * values for "long"), but for PostgreSQL 8.0 at least, the backend appears to * expect a 32-bit number and fails to parse large 64-bit numbers. * We could change the alias to match this behaviour, but that would break * if/when Postgres is changed to accept 64-bit displacements. */ static const std::string All{"ALL"}, BackAll{"BACKWARD ALL"}; if (n >= cursor_base::all()) return All; else if (n <= cursor_base::backward_all()) return BackAll; return to_string(n); } libpqxx-6.4.5/src/statement_parameters.cxx000066400000000000000000000031461350065432700207700ustar00rootroot00000000000000/** Common implementation for statement parameter lists. * * See the connection_base hierarchy for more about prepared statements * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/util" #include "pqxx/internal/statement_parameters.hxx" void pqxx::internal::statement_parameters::add_checked_param( const std::string &value, bool nonnull, bool binary) { m_nonnull.push_back(nonnull); if (nonnull) m_values.push_back(value); m_binary.push_back(binary); } int pqxx::internal::statement_parameters::marshall( std::vector &values, std::vector &lengths, std::vector &binaries) const { const auto elements = m_nonnull.size(); const auto array_size = elements + 1; values.clear(); values.resize(array_size, nullptr); lengths.clear(); lengths.resize(array_size, 0); // "Unpack" from m_values, which skips arguments that are null, to the // outputs which represent all parameters including nulls. size_t arg = 0; for (size_t param = 0; param < elements; ++param) if (m_nonnull[param]) { values[param] = m_values[arg].c_str(); lengths[param] = int(m_values[arg].size()); ++arg; } // The binaries array is simpler: it maps 1-on-1. binaries.resize(array_size); for (size_t param = 0; param < elements; ++param) binaries[param] = int(m_binary[param]); binaries.back() = 0; return int(elements); } libpqxx-6.4.5/src/strconv.cxx000066400000000000000000000442211350065432700162360ustar00rootroot00000000000000/** Implementation of string conversions. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include #include #include #include #if __cplusplus < 201703 // This is not C++17 or better. Don't use to_chars/from_chars; the code which // uses those also relies on other C++17 features. #if defined(PQXX_HAVE_CHARCONV_INT) #undef PQXX_HAVE_CHARCONV_INT #endif #if defined(PQXX_HAVE_CHARCONV_FLOAT) #undef PQXX_HAVE_CHARCONV_FLOAT #endif #endif #if defined(PQXX_HAVE_CHARCONV_INT) || defined(PQXX_HAVE_CHARCONV_FLOAT) #include #endif #if __cplusplus >= 201703 #include #endif #include "pqxx/except" #include "pqxx/strconv" using namespace pqxx::internal; namespace { /// C string comparison. inline bool equal(const char lhs[], const char rhs[]) { return strcmp(lhs, rhs) == 0; } } // namespace namespace pqxx { namespace internal { void throw_null_conversion(const std::string &type) { throw conversion_error{"Attempt to convert null to " + type + "."}; } } // namespace pqxx::internal } // namespace pqxx #if defined(PQXX_HAVE_CHARCONV_INT) || defined(PQXX_HAVE_CHARCONV_FLOAT) namespace { template void wrap_from_chars(std::string_view in, T &out) { using traits = pqxx::string_traits; const char *end = in.data() + in.size(); const auto res = std::from_chars(in.data(), end, out); if (res.ec == std::errc() and res.ptr == end) return; std::string msg; if (res.ec == std::errc()) { msg = "Could not parse full string."; } else switch (res.ec) { case std::errc::result_out_of_range: msg = "Value out of range."; break; case std::errc::invalid_argument: msg = "Invalid argument."; break; default: break; } const std::string base = "Could not convert '" + std::string(in) + "' " "to " + traits::name(); if (msg.empty()) throw pqxx::conversion_error{base + "."}; else throw pqxx::conversion_error{base + ": " + msg}; } /// How big of a buffer do we want for representing a T? template constexpr int size_buffer() { using lim = std::numeric_limits; // Allocate room for how many digits? There's "max_digits10" for // floating-point numbers, but only "digits10" for integer types. constexpr auto digits = std::max({lim::digits10, lim::max_digits10}); // Leave a little bit of extra room for signs, decimal points, and the like. return digits + 4; } /// Call @c std::to_chars. It differs for integer vs. floating-point types. template struct to_chars_caller; #if defined(PQXX_HAVE_CHARCONV_INT) /// For integer types, we pass "base 10" to @c std::to_chars. template struct to_chars_caller { static std::to_chars_result call(char *begin, char *end, TYPE in) { return std::to_chars(begin, end, in, 10); } }; #endif #if defined(PQXX_HAVE_CHARCONV_FLOAT) /// For floating-point types, we pass "general format" to @c std::to_chars. template template struct to_chars_caller { static std::to_chars_result call(char *begin, char *end, TYPE in) { return std::to_chars(begin, end, in, std::chars_format::general); } }; #endif } // namespace namespace pqxx { namespace internal { template std::string builtin_traits::to_string(T in) { using traits = pqxx::string_traits; char buf[size_buffer()]; // Annoying: we need to make slightly different calls to std::to_chars // depending on whether this is an integral type or a floating-point type. // Use to_chars_caller to hide the difference. constexpr bool is_integer = std::numeric_limits::is_integer; const auto res = to_chars_caller::call( buf, buf + sizeof(buf), in); if (res.ec == std::errc()) return std::string(buf, res.ptr); std::string msg; switch (res.ec) { case std::errc::value_too_large: msg = "Value too large."; break; default: break; } const std::string base = std::string{"Could not convert "} + traits::name() + " to string"; if (msg.empty()) throw pqxx::conversion_error{base + "."}; else throw pqxx::conversion_error{base + ": " + msg}; } /// Translate @c from_string calls to @c wrap_from_chars calls. /** The only difference is the type of the string. */ template void builtin_traits::from_string(const char Str[], TYPE &Obj) { wrap_from_chars(std::string_view{Str}, Obj); } } // namespace pqxx::internal } // namespace pqxx #endif // PQXX_HAVE_CHARCONV_INT || PQXX_HAVE_CHARCONV_FLOAT #if !defined(PQXX_HAVE_CHARCONV_FLOAT) namespace { template inline void set_to_Inf(T &t, int sign=1) { T value = std::numeric_limits::infinity(); if (sign < 0) value = -value; t = value; } } // namespace #endif // !PQXX_HAVE_CHARCONV_FLOAT #if !defined(PQXX_HAVE_CHARCONV_INT) namespace { [[noreturn]] void report_overflow() { throw pqxx::conversion_error{ "Could not convert string to integer: value out of range."}; } /** Helper to check for underflow before multiplying a number by 10. * * Needed just so the compiler doesn't get to complain about an "if (n < 0)" * clause that's pointless for unsigned numbers. */ template struct underflow_check; /* Specialization for signed types: check. */ template struct underflow_check { static void check_before_adding_digit(T n) { constexpr T ten{10}; if (n < 0 and (std::numeric_limits::min() / ten) > n) report_overflow(); } }; /* Specialization for unsigned types: no check needed becaue negative * numbers don't exist. */ template struct underflow_check { static void check_before_adding_digit(T) {} }; /// Return 10*n, or throw exception if it overflows. template T safe_multiply_by_ten(T n) { using limits = std::numeric_limits; constexpr T ten{10}; if (n > 0 and (limits::max() / n) < ten) report_overflow(); underflow_check::check_before_adding_digit(n); return T(n * ten); } /// Add a digit d to n, or throw exception if it overflows. template T safe_add_digit(T n, T d) { assert((n >= 0 and d >= 0) or (n <=0 and d <= 0)); if ((n > 0) and (n > (std::numeric_limits::max() - d))) report_overflow(); if ((n < 0) and (n < (std::numeric_limits::min() - d))) report_overflow(); return n + d; } /// For use in string parsing: add new numeric digit to intermediate value template inline L absorb_digit(L value, R digit) { return L(safe_multiply_by_ten(value) + L(digit)); } template void from_string_signed(const char Str[], T &Obj) { int i = 0; T result = 0; if (not isdigit(Str[i])) { if (Str[i] != '-') throw pqxx::conversion_error{ "Could not convert string to integer: '" + std::string{Str} + "'."}; for (++i; isdigit(Str[i]); ++i) result = absorb_digit(result, -digit_to_number(Str[i])); } else { for (; isdigit(Str[i]); ++i) result = absorb_digit(result, digit_to_number(Str[i])); } if (Str[i]) throw pqxx::conversion_error{ "Unexpected text after integer: '" + std::string{Str} + "'."}; Obj = result; } template void from_string_unsigned(const char Str[], T &Obj) { int i = 0; T result = 0; if (not isdigit(Str[i])) throw pqxx::conversion_error{ "Could not convert string to unsigned integer: '" + std::string{Str} + "'."}; for (; isdigit(Str[i]); ++i) result = absorb_digit(result, digit_to_number(Str[i])); if (Str[i]) throw pqxx::conversion_error{ "Unexpected text after integer: '" + std::string{Str} + "'."}; Obj = result; } } // namespace #endif // !PQXX_HAVE_CHARCONV_INT #if !defined(PQXX_HAVE_CHARCONV_FLOAT) namespace { bool valid_infinity_string(const char str[]) noexcept { return equal("infinity", str) or equal("Infinity", str) or equal("INFINITY", str) or equal("inf", str); } /// Wrapper for std::stringstream with C locale. /** Some of our string conversions use the standard library. But, they must * _not_ obey the system's locale settings, or a value like 1000.0 might end * up looking like "1.000,0". * * Initialising the stream (including locale and tweaked precision) seems to * be expensive though. So, create thread-local instances which we re-use. * It's a lockless way of keeping global variables thread-safe, basically. * * The stream initialisation happens once per thread, in the constructor. * And that's why we need to wrap this in a class. We can't just do it at the * call site, or we'd still be doing it for every call. */ template class dumb_stringstream : public std::stringstream { public: // Do not initialise the base-class object using "stringstream{}" (with curly // braces): that breaks on Visual C++. The classic "stringstream()" syntax // (with parentheses) does work. dumb_stringstream() { this->imbue(std::locale::classic()); this->precision(std::numeric_limits::max_digits10); } }; /* These are hard. Sacrifice performance of specialized, nonflexible, * non-localized code and lean on standard library. Some special-case code * handles NaNs. */ template inline void from_string_float(const char Str[], T &Obj) { bool ok = false; T result; switch (Str[0]) { case 'N': case 'n': // Accept "NaN," "nan," etc. ok = ( (Str[1]=='A' or Str[1]=='a') and (Str[2]=='N' or Str[2]=='n') and (Str[3] == '\0')); result = std::numeric_limits::quiet_NaN(); break; case 'I': case 'i': ok = valid_infinity_string(Str); set_to_Inf(result); break; default: if (Str[0] == '-' and valid_infinity_string(&Str[1])) { ok = true; set_to_Inf(result, -1); } else { thread_local dumb_stringstream S; // Visual Studio 2017 seems to fail on repeated conversions if the // clear() is done before the seekg(). Still don't know why! See #124 // and #125. S.seekg(0); S.clear(); S.str(Str); ok = static_cast(S >> result); } break; } if (not ok) throw pqxx::conversion_error{ "Could not convert string to numeric value: '" + std::string{Str} + "'."}; Obj = result; } } // namespace #endif // !PQXX_HAVE_CHARCONV_FLOAT #if !defined(PQXX_HAVE_CHARCONV_INT) namespace { template inline std::string to_string_unsigned(T Obj) { if (not Obj) return "0"; // Every byte of width on T adds somewhere between 3 and 4 digits to the // maximum length of our decimal string. char buf[4*sizeof(T)+1]; char *p = &buf[sizeof(buf)]; *--p = '\0'; while (Obj > 0) { *--p = number_to_digit(int(Obj%10)); Obj = T(Obj / 10); } return p; } } // namespace #endif // !PQXX_HAVE_CHARCONV_INT #if !defined(PQXX_HAVE_CHARCONV_INT) || !defined(PQXX_HAVE_CHARCONV_FLOAT) namespace { template inline std::string to_string_fallback(T Obj) { thread_local dumb_stringstream S; S.str(""); S << Obj; return S.str(); } } // namespace #endif // !PQXX_HAVE_CHARCONV_INT || !PQXX_HAVE_CHARCONV_FLOAT #if !defined(PQXX_HAVE_CHARCONV_FLOAT) namespace { template inline std::string to_string_float(T Obj) { if (std::isnan(Obj)) return "nan"; if (std::isinf(Obj)) return Obj > 0 ? "infinity" : "-infinity"; return to_string_fallback(Obj); } } // namespace #endif // !PQXX_HAVE_CHARCONV_FLOAT #if !defined(PQXX_HAVE_CHARCONV_INT) namespace { template inline std::string to_string_signed(T Obj) { if (Obj < 0) { // Remember--the smallest negative number for a given two's-complement type // cannot be negated. const bool negatable = (Obj != std::numeric_limits::min()); if (negatable) return '-' + to_string_unsigned(-Obj); else return to_string_fallback(Obj); } return to_string_unsigned(Obj); } } // namespace #endif // !PQXX_HAVE_CHARCONV_INT #if defined(PQXX_HAVE_CHARCONV_INT) namespace pqxx { template void builtin_traits::from_string(const char[], short &); template void builtin_traits::from_string(const char[], unsigned short &); template void builtin_traits::from_string(const char[], int &); template void builtin_traits::from_string(const char[], unsigned int &); template void builtin_traits::from_string(const char[], long &); template void builtin_traits::from_string(const char[], unsigned long &); template void builtin_traits::from_string(const char[], long long &); template void builtin_traits::from_string( const char[], unsigned long long &); } // namespace pqxx #endif // PQXX_HAVE_CHARCONV_INT #if defined(PQXX_HAVE_CHARCONV_FLOAT) namespace pqxx { template void string_traits::from_string(const char Str[], float &Obj); template void string_traits::from_string(const char Str[], double &Obj); template void string_traits::from_string( const char Str[], long double &Obj); } // namespace pqxx #endif // PQXX_HAVE_CHARCONV_FLOAT #if defined(PQXX_HAVE_CHARCONV_INT) namespace pqxx { namespace internal { template std::string builtin_traits::to_string(short Obj); template std::string builtin_traits::to_string(unsigned short Obj); template std::string builtin_traits::to_string(int Obj); template std::string builtin_traits::to_string(unsigned int Obj); template std::string builtin_traits::to_string(long Obj); template std::string builtin_traits::to_string(unsigned long Obj); template std::string builtin_traits::to_string(long long Obj); template std::string builtin_traits::to_string( unsigned long long Obj); } // namespace pqxx::internal } // namespace pqxx #endif // PQXX_HAVE_CHARCONV_INT #if defined(PQXX_HAVE_CHARCONV_FLOAT) namespace pqxx { namespace internal { template std::string builtin_traits::to_string(float Obj); template std::string builtin_traits::to_string(double Obj); template std::string builtin_traits::to_string(long double Obj); } // namespace pqxx::internal } // namespace pqxx #endif // PQXX_HAVE_CHARCONV_FLOAT #if !defined(PQXX_HAVE_CHARCONV_INT) namespace pqxx { namespace internal { template<> void builtin_traits::from_string(const char Str[], short &Obj) { from_string_signed(Str, Obj); } template<> std::string builtin_traits::to_string(short Obj) { return to_string_signed(Obj); } template<> void builtin_traits::from_string( const char Str[], unsigned short &Obj) { from_string_unsigned(Str, Obj); } template<> std::string builtin_traits::to_string(unsigned short Obj) { return to_string_unsigned(Obj); } template<> void builtin_traits::from_string(const char Str[], int &Obj) { from_string_signed(Str, Obj); } template<> std::string builtin_traits::to_string(int Obj) { return to_string_signed(Obj); } template<> void builtin_traits::from_string( const char Str[], unsigned int &Obj) { from_string_unsigned(Str, Obj); } template<> std::string builtin_traits::to_string(unsigned int Obj) { return to_string_unsigned(Obj); } template<> void builtin_traits::from_string(const char Str[], long &Obj) { from_string_signed(Str, Obj); } template<> std::string builtin_traits::to_string(long Obj) { return to_string_signed(Obj); } template<> void builtin_traits::from_string( const char Str[], unsigned long &Obj) { from_string_unsigned(Str, Obj); } template<> std::string builtin_traits::to_string(unsigned long Obj) { return to_string_unsigned(Obj); } template<> void builtin_traits::from_string(const char Str[], long long &Obj) { from_string_signed(Str, Obj); } template<> std::string builtin_traits::to_string(long long Obj) { return to_string_signed(Obj); } template<> void builtin_traits::from_string( const char Str[], unsigned long long &Obj) { from_string_unsigned(Str, Obj); } template<> std::string builtin_traits::to_string( unsigned long long Obj) { return to_string_unsigned(Obj); } } // namespace pqxx::internal } // namespace pqxx #endif // !PQXX_HAVE_CHARCONV_INT #if !defined(PQXX_HAVE_CHARCONV_FLOAT) namespace pqxx { namespace internal { template<> void builtin_traits::from_string(const char Str[], float &Obj) { from_string_float(Str, Obj); } template<> std::string builtin_traits::to_string(float Obj) { return to_string_float(Obj); } template<> void builtin_traits::from_string(const char Str[], double &Obj) { from_string_float(Str, Obj); } template<> std::string builtin_traits::to_string(double Obj) { return to_string_float(Obj); } template<> void builtin_traits::from_string( const char Str[], long double &Obj) { from_string_float(Str, Obj); } template<> std::string builtin_traits::to_string(long double Obj) { return to_string_float(Obj); } } // namespace pqxx::internal } // namespace pqxx #endif // !PQXX_HAVE_CHARCONV_FLOAT namespace pqxx { namespace internal { template<> void builtin_traits::from_string(const char Str[], bool &Obj) { bool OK, result=false; switch (Str[0]) { case 0: result = false; OK = true; break; case 'f': case 'F': result = false; OK = not ( (Str[1] != '\0') and (not equal(Str+1, "alse")) and (not equal(Str+1, "ALSE"))); break; case '0': { int I; string_traits::from_string(Str, I); result = (I != 0); OK = ((I == 0) or (I == 1)); } break; case '1': result = true; OK = (Str[1] == '\0'); break; case 't': case 'T': result = true; OK = not ( (Str[1] != '\0') and (not equal(Str+1, "rue")) and (not equal(Str+1, "RUE"))); break; default: OK = false; } if (not OK) throw conversion_error{ "Failed conversion to bool: '" + std::string{Str} + "'."}; Obj = result; } template<> std::string builtin_traits::to_string(bool Obj) { return Obj ? "true" : "false"; } } // namespace pqxx::internal } // namespace pqxx libpqxx-6.4.5/src/stream_base.cxx000066400000000000000000000016061350065432700170250ustar00rootroot00000000000000/** Implementation of the pqxx::stream_base class. * * pqxx::stream_base provides optimized batch access to a database table. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/stream_base.hxx" #include "pqxx/transaction" pqxx::stream_base::stream_base(transaction_base &tb) : internal::namedclass("stream_base"), internal::transactionfocus{tb}, m_finished{false} {} pqxx::stream_base::operator bool() const noexcept { return not m_finished; } bool pqxx::stream_base::operator!() const noexcept { return not static_cast(*this); } void pqxx::stream_base::close() { if (*this) { m_finished = true; unregister_me(); } } libpqxx-6.4.5/src/stream_from.cxx000066400000000000000000000133601350065432700170560ustar00rootroot00000000000000/** Implementation of the pqxx::stream_from class. * * pqxx::stream_from enables optimized batch reads from a database table. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/stream_from" #include "pqxx/internal/encodings.hxx" #include "pqxx/internal/gates/transaction-stream_from.hxx" namespace { // bool is_octalchar(char o) noexcept // { // return (o>='0') and (o<='7'); // } /// Find first tab character at or after start position in string /** If not found, returns line.size() rather than string::npos. */ std::string::size_type find_tab( pqxx::internal::encoding_group enc, const std::string &line, std::string::size_type start ) { auto here = pqxx::internal::find_with_encoding(enc, line, '\t', start); return (here == std::string::npos) ? line.size() : here; } } // namespace pqxx::stream_from::stream_from( transaction_base &tb, const std::string &table_name ) : namedclass{"stream_from", table_name}, stream_base{tb}, m_retry_line{false} { set_up(tb, table_name); } pqxx::stream_from::~stream_from() noexcept { try { complete(); } catch (const std::exception &e) { reg_pending_error(e.what()); } } void pqxx::stream_from::complete() { close(); } bool pqxx::stream_from::get_raw_line(std::string &line) { internal::gate::transaction_stream_from gate{m_trans}; if (*this) try { if (not gate.read_copy_line(line)) close(); } catch (const std::exception &) { close(); throw; } return *this; } void pqxx::stream_from::set_up( transaction_base &tb, const std::string &table_name ) { set_up(tb, table_name, ""); } void pqxx::stream_from::set_up( transaction_base &tb, const std::string &table_name, const std::string &columns ) { // Get the encoding before starting the COPY, otherwise reading the the // variable will interrupt it m_copy_encoding = internal::enc_group(m_trans.conn().encoding_id()); internal::gate::transaction_stream_from{tb}.BeginCopyRead( table_name, columns ); register_me(); } void pqxx::stream_from::close() { pqxx::stream_base::close(); try { // Flush any remaining lines std::string s; while (get_raw_line(s)); } catch (const broken_connection &) { try { pqxx::stream_base::close(); } catch (const std::exception &) {} throw; } catch (const std::exception &e) { reg_pending_error(e.what()); } } bool pqxx::stream_from::extract_field( const std::string &line, std::string::size_type &i, std::string &s ) const { using namespace pqxx::internal; const auto next_seq = get_glyph_scanner(m_copy_encoding); s.clear(); bool is_null{false}; auto stop = find_tab(m_copy_encoding, line, i); while (i < stop) { auto glyph_end = next_seq(line.c_str(), line.size(), i); auto seq_len = glyph_end - i; if (seq_len == 1) { switch (line[i]) { case '\n': // End-of-row; shouldn't happen, but we may get old-style // newline-terminated lines. i = stop; break; case '\\': { // Escape sequence. if (glyph_end >= line.size()) throw failure{"Row ends in backslash"}; char n = line[glyph_end++]; /* * "Presently, COPY TO will never emit an octal or hex-digits * backslash sequence [...]" * - https://www.postgresql.org/docs/10/sql-copy.html */ // if (is_octalchar(n)) // { // if (here.end_byte+2 >= line.size()) // throw failure{"Row ends in middle of octal value"}; // char n1 = line[here.end_byte++]; // char n2 = line[here.end_byte++]; // if (not is_octalchar(n1) or not is_octalchar(n2)) // throw failure{ // "Invalid octal in encoded table stream" // }; // s += ( // (digit_to_number(n)<<6) | // (digit_to_number(n1)<<3) | // digit_to_number(n2) // ); // break; // } // else switch (n) { case 'N': // Null value if (not s.empty()) throw failure{ "Null sequence found in nonempty field" }; is_null = true; break; case 'b': // Backspace s += '\b'; break; case 'f': // Vertical tab s += '\f'; break; case 'n': // Form feed s += '\n'; break; case 'r': // Newline s += '\r'; break; case 't': // Tab s += '\t'; break; case 'v': // Carriage return s += '\v'; break; default: // Self-escaped character s += n; break; } } break; default: s += line[i]; break; } } else { // Multi-byte sequence; never treated specially, so just append s.insert(s.size(), line.c_str() + i, seq_len); } i = glyph_end; } // Skip field separator i += 1; return not is_null; } template<> void pqxx::stream_from::extract_value( const std::string &line, std::nullptr_t&, std::string::size_type &here, std::string &workspace ) const { if (extract_field(line, here, workspace)) throw pqxx::conversion_error{ "Attempt to convert non-null '" + workspace + "' to null" }; } libpqxx-6.4.5/src/stream_to.cxx000066400000000000000000000052341350065432700165360ustar00rootroot00000000000000/** Implementation of the pqxx::stream_to class. * * pqxx::stream_to enables optimized batch updates to a database table. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/stream_to.hxx" #include "pqxx/internal/gates/transaction-stream_to.hxx" pqxx::stream_to::stream_to( transaction_base &tb, const std::string &table_name ) : namedclass{"stream_to", table_name}, stream_base{tb} { set_up(tb, table_name); } pqxx::stream_to::~stream_to() noexcept { try { complete(); } catch (const std::exception &e) { reg_pending_error(e.what()); } } void pqxx::stream_to::complete() { close(); } void pqxx::stream_to::write_raw_line(const std::string &line) { internal::gate::transaction_stream_to{m_trans}.write_copy_line(line); } pqxx::stream_to & pqxx::stream_to::operator<<(stream_from &tr) { std::string line; while (tr) { tr.get_raw_line(line); write_raw_line(line); } return *this; } void pqxx::stream_to::set_up( transaction_base &tb, const std::string &table_name ) { set_up(tb, table_name, ""); } void pqxx::stream_to::set_up( transaction_base &tb, const std::string &table_name, const std::string &columns ) { internal::gate::transaction_stream_to{tb}.BeginCopyWrite( table_name, columns ); register_me(); } void pqxx::stream_to::close() { if (*this) { stream_base::close(); try { internal::gate::transaction_stream_to{m_trans}.end_copy_write(); } catch (const std::exception &) { try { stream_base::close(); } catch (const std::exception &) {} throw; } } } std::string pqxx::internal::TypedCopyEscaper::escape(const std::string &s) { if (s.empty()) return s; std::string escaped; escaped.reserve(s.size()+1); for (auto c : s) switch (c) { case '\b': escaped += "\\b"; break; // Backspace case '\f': escaped += "\\f"; break; // Vertical tab case '\n': escaped += "\\n"; break; // Form feed case '\r': escaped += "\\r"; break; // Newline case '\t': escaped += "\\t"; break; // Tab case '\v': escaped += "\\v"; break; // Carriage return case '\\': escaped += "\\\\"; break; // Backslash default: if (c < ' ' or c > '~') { escaped += "\\"; for (auto i = 2; i >= 0; --i) escaped += number_to_digit((c >> (3*i)) & 0x07); } else escaped += c; break; } return escaped; } libpqxx-6.4.5/src/subtransaction.cxx000066400000000000000000000030601350065432700175730ustar00rootroot00000000000000/** Implementation of the pqxx::subtransaction class. * * pqxx::transaction is a nested transaction, i.e. one within a transaction * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/connection_base" #include "pqxx/subtransaction" #include "pqxx/internal/gates/transaction-subtransaction.hxx" using namespace pqxx::internal; pqxx::subtransaction::subtransaction( dbtransaction &T, const std::string &Name) : namedclass{"subtransaction", T.conn().adorn_name(Name)}, transactionfocus{T}, dbtransaction(T.conn(), false), m_parent{T} { } namespace { using dbtransaction_ref = pqxx::dbtransaction &; } pqxx::subtransaction::subtransaction( subtransaction &T, const std::string &Name) : subtransaction(dbtransaction_ref(T), Name) { } void pqxx::subtransaction::do_begin() { try { direct_exec(("SAVEPOINT " + quote_name(name())).c_str()); } catch (const sql_error &) { throw; } } void pqxx::subtransaction::do_commit() { const int ra = m_reactivation_avoidance.get(); m_reactivation_avoidance.clear(); direct_exec(("RELEASE SAVEPOINT " + quote_name(name())).c_str()); gate::transaction_subtransaction{m_parent}.add_reactivation_avoidance_count( ra); } void pqxx::subtransaction::do_abort() { direct_exec(("ROLLBACK TO SAVEPOINT " + quote_name(name())).c_str()); } libpqxx-6.4.5/src/tablereader.cxx000066400000000000000000000107751350065432700170210ustar00rootroot00000000000000/** Implementation of the pqxx::tablereader class. * * pqxx::tablereader enables optimized batch reads from a database table. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/tablereader" #include "pqxx/transaction" #include "pqxx/internal/gates/transaction-tablereader.hxx" using namespace pqxx::internal; pqxx::tablereader::tablereader( transaction_base &T, const std::string &Name, const std::string &Null) : namedclass{"tablereader", Name}, tablestream(T, Null), m_done{true} { set_up(T, Name); } void pqxx::tablereader::set_up( transaction_base &T, const std::string &Name, const std::string &Columns) { gate::transaction_tablereader{T}.BeginCopyRead(Name, Columns); register_me(); m_done = false; } pqxx::tablereader::~tablereader() noexcept { try { reader_close(); } catch (const std::exception &e) { reg_pending_error(e.what()); } } bool pqxx::tablereader::get_raw_line(std::string &Line) { if (not m_done) try { m_done = not gate::transaction_tablereader{m_trans}.read_copy_line(Line); } catch (const std::exception &) { m_done = true; throw; } return not m_done; } void pqxx::tablereader::complete() { reader_close(); } void pqxx::tablereader::reader_close() { if (not is_finished()) { base_close(); // If any lines remain to be read, consume them to not confuse PQendcopy() if (not m_done) { try { std::string Dummy; while (get_raw_line(Dummy)) ; } catch (const broken_connection &) { try { base_close(); } catch (const std::exception &) {} throw; } catch (const std::exception &e) { reg_pending_error(e.what()); } } } } namespace { inline bool is_octalchar(char o) noexcept { return (o>='0') and (o<='7'); } /// Find first tab character at or after start position in string /** If not found, returns Line.size() rather than string::npos. */ std::string::size_type findtab( const std::string &Line, std::string::size_type start) { // TODO: Fix for multibyte encodings? const auto here = Line.find('\t', start); return (here == std::string::npos) ? Line.size() : here; } } // namespace std::string pqxx::tablereader::extract_field( const std::string &Line, std::string::size_type &i) const { // TODO: Pick better exception types std::string R; bool isnull=false; auto stop = findtab(Line, i); for (; i < stop; ++i) { const char c = Line[i]; switch (c) { case '\n': // End of row // Shouldn't happen, but we may get old-style, newline-terminated lines i = stop; break; case '\\': // Escape sequence { const char n = Line[++i]; if (i >= Line.size()) throw failure{"Row ends in backslash."}; switch (n) { case 'N': // Null value if (not R.empty()) throw failure{"Null sequence found in nonempty field."}; R = NullStr(); isnull = true; break; case '0': // Octal sequence (3 digits) case '1': case '2': case '3': case '4': case '5': case '6': case '7': { if ((i+2) >= Line.size()) throw failure{"Row ends in middle of octal value."}; const char n1 = Line[++i]; const char n2 = Line[++i]; if (not is_octalchar(n1) or not is_octalchar(n2)) throw failure{"Invalid octal in encoded table stream."}; R += char( (digit_to_number(n)<<6) | (digit_to_number(n1)<<3) | digit_to_number(n2)); } break; case 'b': // TODO: Escape code? R += char(8); break; // Backspace case 'v': // TODO: Escape code? R += char(11); break; // Vertical tab case 'f': // TODO: Escape code? R += char(12); break; // Form feed case 'n': R += '\n'; break; // Newline case 't': R += '\t'; break; // Tab case 'r': R += '\r'; break; // Carriage return; default: // Self-escaped character R += n; // This may be a self-escaped tab that we thought was a terminator... if (i == stop) { if ((i+1) >= Line.size()) throw internal_error{"COPY line ends in backslash."}; stop = findtab(Line, i+1); } break; } } break; default: R += c; break; } } ++i; if (isnull and (R.size() != NullStr().size())) throw failure{"Field contains data behind null sequence."}; return R; } libpqxx-6.4.5/src/tablestream.cxx000066400000000000000000000014611350065432700170420ustar00rootroot00000000000000/** Implementation of the pqxx::tablestream class. * * pqxx::tablestream provides optimized batch access to a database table. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/tablestream" #include "pqxx/transaction" pqxx::tablestream::tablestream(transaction_base &STrans, const std::string &Null) : internal::namedclass{"tablestream"}, internal::transactionfocus{STrans}, m_null{Null} { } pqxx::tablestream::~tablestream() noexcept { } void pqxx::tablestream::base_close() { if (not is_finished()) { m_finished = true; unregister_me(); } } libpqxx-6.4.5/src/tablewriter.cxx000066400000000000000000000061151350065432700170640ustar00rootroot00000000000000/** Implementation of the pqxx::tablewriter class. * * pqxx::tablewriter enables optimized batch updates to a database table. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include "pqxx/tablereader" #include "pqxx/tablewriter" #include "pqxx/transaction" #include "pqxx/internal/gates/transaction-tablewriter.hxx" using namespace pqxx::internal; pqxx::tablewriter::tablewriter( transaction_base &T, const std::string &WName, const std::string &Null) : namedclass{"tablewriter", WName}, tablestream(T, Null) { set_up(T, WName); } pqxx::tablewriter::~tablewriter() noexcept { try { writer_close(); } catch (const std::exception &e) { reg_pending_error(e.what()); } } void pqxx::tablewriter::set_up( transaction_base &T, const std::string &WName, const std::string &Columns) { gate::transaction_tablewriter{T}.BeginCopyWrite(WName, Columns); register_me(); } pqxx::tablewriter &pqxx::tablewriter::operator<<(pqxx::tablereader &R) { std::string Line; // TODO: Can we do this in binary mode? (Might require protocol version check) while (R.get_raw_line(Line)) write_raw_line(Line); return *this; } void pqxx::tablewriter::write_raw_line(const std::string &Line) { const std::string::size_type len = Line.size(); gate::transaction_tablewriter{m_trans}.write_copy_line( ((len == 0) or (Line[len-1] != '\n')) ? Line : std::string{Line, 0, len-1}); } void pqxx::tablewriter::complete() { writer_close(); } void pqxx::tablewriter::writer_close() { if (not is_finished()) { base_close(); try { gate::transaction_tablewriter{m_trans}.end_copy_write(); } catch (const std::exception &) { try { base_close(); } catch (const std::exception &) {} throw; } } } namespace { inline char escapechar(char i) noexcept { char r = '\0'; switch (i) { case 8: r='b'; break; // backspace case 11: r='v'; break; // vertical tab case 12: r='f'; break; // form feed case '\n': r='n'; break; // newline case '\t': r='t'; break; // tab case '\r': r='r'; break; // carriage return case '\\': r='\\'; break; // backslash } return r; } inline bool unprintable(char i) noexcept { return i < ' ' or i > '~'; } inline char tooctdigit(char c, int n) { using unsigned_char = unsigned char; unsigned int i = unsigned_char(c); return number_to_digit((i>>(3*n)) & 0x07); } } // namespace std::string pqxx::internal::escape( const std::string &s, const std::string &null) { if (s == null) return "\\N"; if (s.empty()) return s; std::string R; R.reserve(s.size()+1); for (const auto c: s) { const char e = escapechar(c); if (e) { R += '\\'; R += e; } else if (unprintable(c)) { R += "\\\\"; for (int n=2; n>=0; --n) R += tooctdigit(c, n); } else { R += c; } } return R; } libpqxx-6.4.5/src/transaction.cxx000066400000000000000000000037021350065432700170640ustar00rootroot00000000000000/** Implementation of the pqxx::transaction class. * * pqxx::transaction represents a regular database transaction. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include "pqxx/connection_base" #include "pqxx/result" #include "pqxx/transaction" pqxx::internal::basic_transaction::basic_transaction( connection_base &C, const std::string &IsolationLevel, readwrite_policy rw) : namedclass{"transaction"}, dbtransaction(C, IsolationLevel, rw) { } void pqxx::internal::basic_transaction::do_commit() { try { direct_exec("COMMIT"); } catch (const statement_completion_unknown &e) { // Outcome of "commit" is unknown. This is a disaster: we don't know the // resulting state of the database. process_notice(e.what() + std::string{"\n"}); const std::string msg = "WARNING: Commit of transaction '" + name() + "' is unknown. " "There is no way to tell whether the transaction succeeded " "or was aborted except to check manually."; process_notice(msg + "\n"); throw in_doubt_error{msg}; } catch (const std::exception &e) { if (not conn().is_open()) { // We've lost the connection while committing. There is just no way of // telling what happened on the other end. >8-O process_notice(e.what() + std::string{"\n"}); const std::string Msg = "WARNING: Connection lost while committing transaction " "'" + name() + "'. " "There is no way to tell whether the transaction succeeded " "or was aborted except to check manually."; process_notice(Msg + "\n"); throw in_doubt_error{Msg}; } else { // Commit failed--probably due to a constraint violation or something // similar. throw; } } } libpqxx-6.4.5/src/transaction_base.cxx000066400000000000000000000324641350065432700200650ustar00rootroot00000000000000/** Common code and definitions for the transaction classes. * * pqxx::transaction_base defines the interface for any abstract class that * represents a database transaction. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include "pqxx/connection_base" #include "pqxx/result" #include "pqxx/transaction_base" #include "pqxx/internal/gates/connection-transaction.hxx" #include "pqxx/internal/gates/connection-parameterized_invocation.hxx" #include "pqxx/internal/gates/transaction-transactionfocus.hxx" #include "pqxx/internal/encodings.hxx" using namespace pqxx::internal; pqxx::internal::parameterized_invocation::parameterized_invocation( connection_base &c, const std::string &query) : m_home{c}, m_query{query} { } pqxx::result pqxx::internal::parameterized_invocation::exec() { std::vector values; std::vector lengths; std::vector binaries; const int elements = marshall(values, lengths, binaries); return gate::connection_parameterized_invocation{m_home}.parameterized_exec( m_query, values.data(), lengths.data(), binaries.data(), elements); } pqxx::transaction_base::transaction_base(connection_base &C, bool direct) : namedclass{"transaction_base"}, m_conn{C} { if (direct) { gate::connection_transaction gate{conn()}; gate.register_transaction(this); m_registered = true; } } pqxx::transaction_base::~transaction_base() { try { reactivation_avoidance_clear(); if (not m_pending_error.empty()) process_notice("UNPROCESSED ERROR: " + m_pending_error + "\n"); if (m_registered) { m_conn.process_notice(description() + " was never closed properly!\n"); gate::connection_transaction gate{conn()}; gate.unregister_transaction(this); } } catch (const std::exception &e) { try { process_notice(std::string{e.what()} + "\n"); } catch (const std::exception &) { process_notice(e.what()); } } } void pqxx::transaction_base::commit() { CheckPendingError(); // Check previous status code. Caller should only call this function if // we're in "implicit" state, but multiple commits are silently accepted. switch (m_status) { case st_nascent: // Empty transaction. No skin off our nose. return; case st_active: // Just fine. This is what we expect. break; case st_aborted: throw usage_error{"Attempt to commit previously aborted " + description()}; case st_committed: // Transaction has been committed already. This is not exactly proper // behaviour, but throwing an exception here would only give the impression // that an abort is needed--which would only confuse things further at this // stage. // Therefore, multiple commits are accepted, though under protest. m_conn.process_notice(description() + " committed more than once.\n"); return; case st_in_doubt: // Transaction may or may not have been committed. The only thing we can // really do is keep telling the caller that the transaction is in doubt. throw in_doubt_error{ description() + " committed again while in an indeterminate state."}; default: throw internal_error{"pqxx::transaction: invalid status code."}; } // Tricky one. If stream is nested in transaction but inside the same scope, // the commit() will come before the stream is closed. Which means the // commit is premature. Punish this swiftly and without fail to discourage // the habit from forming. if (m_focus.get()) throw failure{ "Attempt to commit " + description() + " with " + m_focus.get()->description() + " still open."}; // Check that we're still connected (as far as we know--this is not an // absolute thing!) before trying to commit. If the connection was broken // already, the commit would fail anyway but this way at least we don't remain // in-doubt as to whether the backend got the commit order at all. if (not m_conn.is_open()) throw broken_connection{ "Broken connection to backend; cannot complete transaction."}; try { do_commit(); m_status = st_committed; } catch (const in_doubt_error &) { m_status = st_in_doubt; throw; } catch (const std::exception &) { m_status = st_aborted; throw; } gate::connection_transaction gate{conn()}; gate.add_variables(m_vars); End(); } void pqxx::transaction_base::abort() { // Check previous status code. Quietly accept multiple aborts to // simplify emergency bailout code. switch (m_status) { case st_nascent: // Never began transaction. No need to issue rollback. break; case st_active: try { do_abort(); } catch (const std::exception &) { } break; case st_aborted: return; case st_committed: throw usage_error{"Attempt to abort previously committed " + description()}; case st_in_doubt: // Aborting an in-doubt transaction is probably a reasonably sane response // to an insane situation. Log it, but do not complain. m_conn.process_notice( "Warning: " + description() + " aborted after going into " "indeterminate state; it may have been executed anyway.\n"); return; default: throw internal_error{"Invalid transaction status."}; } m_status = st_aborted; End(); } std::string pqxx::transaction_base::esc_raw(const std::string &str) const { const unsigned char *p = reinterpret_cast(str.c_str()); return conn().esc_raw(p, str.size()); } std::string pqxx::transaction_base::quote_raw(const std::string &str) const { const unsigned char *p = reinterpret_cast(str.c_str()); return conn().quote_raw(p, str.size()); } void pqxx::transaction_base::activate() { switch (m_status) { case st_nascent: // Make sure transaction has begun before executing anything Begin(); break; case st_active: break; case st_committed: case st_aborted: case st_in_doubt: throw usage_error{ "Attempt to activate " + description() + " " "which is already closed."}; default: throw internal_error{"pqxx::transaction: invalid status code."}; } } pqxx::result pqxx::transaction_base::exec( const std::string &Query, const std::string &Desc) { CheckPendingError(); const std::string N = (Desc.empty() ? "" : "'" + Desc + "' "); if (m_focus.get()) throw usage_error{ "Attempt to execute query " + N + "on " + description() + " " "with " + m_focus.get()->description() + " still open."}; try { activate(); } catch (const usage_error &e) { throw usage_error{"Error executing query " + N + ". " + e.what()}; } // TODO: Pass Desc to do_exec(), and from there on down return do_exec(Query.c_str()); } pqxx::result pqxx::transaction_base::exec_n( size_t rows, const std::string &Query, const std::string &Desc) { const result r = exec(Query, Desc); if (r.size() != rows) { const std::string N = (Desc.empty() ? "" : "'" + Desc + "'"); throw unexpected_rows{ "Expected " + to_string(rows) + " row(s) of data " "from query " + N + ", got " + to_string(r.size()) + "."}; } return r; } void pqxx::transaction_base::check_rowcount_prepared( const std::string &statement, size_t expected_rows, size_t actual_rows) { if (actual_rows != expected_rows) { throw unexpected_rows{ "Expected " + to_string(expected_rows) + " row(s) of data " "from prepared statement '" + statement + "', got " + to_string(actual_rows) + "."}; } } void pqxx::transaction_base::check_rowcount_params( size_t expected_rows, size_t actual_rows) { if (actual_rows != expected_rows) { throw unexpected_rows{ "Expected " + to_string(expected_rows) + " row(s) of data " "from parameterised query, got " + to_string(actual_rows) + "."}; } } pqxx::internal::parameterized_invocation pqxx::transaction_base::parameterized(const std::string &query) { #include "pqxx/internal/ignore-deprecated-pre.hxx" return internal::parameterized_invocation{conn(), query}; #include "pqxx/internal/ignore-deprecated-post.hxx" } pqxx::prepare::invocation pqxx::transaction_base::prepared(const std::string &statement) { try { activate(); } catch (const usage_error &e) { throw usage_error{ "Error executing prepared statement " + statement + ". " + e.what()}; } #include "pqxx/internal/ignore-deprecated-pre.hxx" return prepare::invocation{*this, statement}; #include "pqxx/internal/ignore-deprecated-post.hxx" } pqxx::result pqxx::transaction_base::internal_exec_prepared( const std::string &statement, const internal::params &args) { gate::connection_transaction gate{conn()}; return gate.exec_prepared(statement, args); } pqxx::result pqxx::transaction_base::internal_exec_params( const std::string &query, const internal::params &args) { gate::connection_transaction gate{conn()}; return gate.exec_params(query, args); } void pqxx::transaction_base::set_variable( const std::string &Var, const std::string &Value) { // Before committing to this new value, see what the backend thinks about it gate::connection_transaction gate{conn()}; gate.raw_set_var(Var, Value); m_vars[Var] = Value; } std::string pqxx::transaction_base::get_variable(const std::string &Var) { const std::map::const_iterator i = m_vars.find(Var); if (i != m_vars.end()) return i->second; return gate::connection_transaction{conn()}.raw_get_var(Var); } void pqxx::transaction_base::Begin() { if (m_status != st_nascent) throw internal_error{ "pqxx::transaction: Begin() called while not in nascent state."}; try { // Better handle any pending notifications before we begin m_conn.get_notifs(); do_begin(); m_status = st_active; } catch (const std::exception &) { End(); throw; } } void pqxx::transaction_base::End() noexcept { try { try { CheckPendingError(); } catch (const std::exception &e) { m_conn.process_notice(e.what()); } gate::connection_transaction gate{conn()}; if (m_registered) { m_registered = false; gate.unregister_transaction(this); } if (m_status != st_active) return; if (m_focus.get()) m_conn.process_notice( "Closing " + description() + " with " + m_focus.get()->description() + " still open.\n"); try { abort(); } catch (const std::exception &e) { m_conn.process_notice(e.what()); } gate.take_reactivation_avoidance(m_reactivation_avoidance.get()); m_reactivation_avoidance.clear(); } catch (const std::exception &e) { try { m_conn.process_notice(e.what()); } catch (const std::exception &) {} } } void pqxx::transaction_base::register_focus(internal::transactionfocus *S) { m_focus.register_guest(S); } void pqxx::transaction_base::unregister_focus(internal::transactionfocus *S) noexcept { try { m_focus.unregister_guest(S); } catch (const std::exception &e) { m_conn.process_notice(std::string{e.what()} + "\n"); } } pqxx::result pqxx::transaction_base::direct_exec(const char C[], int Retries) { CheckPendingError(); return gate::connection_transaction{conn()}.exec(C, Retries); } void pqxx::transaction_base::register_pending_error(const std::string &Err) noexcept { if (m_pending_error.empty() and not Err.empty()) { try { m_pending_error = Err; } catch (const std::exception &e) { try { process_notice("UNABLE TO PROCESS ERROR\n"); process_notice(e.what()); process_notice("ERROR WAS:"); process_notice(Err); } catch (...) { } } } } void pqxx::transaction_base::CheckPendingError() { if (not m_pending_error.empty()) { const std::string Err{m_pending_error}; m_pending_error.clear(); throw failure{Err}; } } namespace { std::string MakeCopyString( const std::string &Table, const std::string &Columns) { std::string Q = "COPY " + Table + " "; if (not Columns.empty()) Q += "(" + Columns + ") "; return Q; } } // namespace void pqxx::transaction_base::BeginCopyRead( const std::string &Table, const std::string &Columns) { exec(MakeCopyString(Table, Columns) + "TO STDOUT"); } void pqxx::transaction_base::BeginCopyWrite( const std::string &Table, const std::string &Columns) { exec(MakeCopyString(Table, Columns) + "FROM STDIN"); } bool pqxx::transaction_base::read_copy_line(std::string &line) { return gate::connection_transaction{conn()}.read_copy_line(line); } void pqxx::transaction_base::write_copy_line(const std::string &line) { gate::connection_transaction gate{conn()}; gate.write_copy_line(line); } void pqxx::transaction_base::end_copy_write() { gate::connection_transaction gate{conn()}; gate.end_copy_write(); } void pqxx::internal::transactionfocus::register_me() { gate::transaction_transactionfocus gate{m_trans}; gate.register_focus(this); m_registered = true; } void pqxx::internal::transactionfocus::unregister_me() noexcept { gate::transaction_transactionfocus gate{m_trans}; gate.unregister_focus(this); m_registered = false; } void pqxx::internal::transactionfocus::reg_pending_error(const std::string &err) noexcept { gate::transaction_transactionfocus gate{m_trans}; gate.register_pending_error(err); } libpqxx-6.4.5/src/util.cxx000066400000000000000000000051201350065432700155100ustar00rootroot00000000000000/** Various utility functions. * * Copyright (c) 2000-2019, Jeroen T. Vermeulen. * * See COPYING for copyright license. If you did not receive a file called * COPYING with this source code, please notify the distributor of this mistake, * or contact the author. */ #include "pqxx/compiler-internal.hxx" #include #include #include #include #include #include #include extern "C" { #include "libpq-fe.h" } #include "pqxx/except" #include "pqxx/util" using namespace pqxx::internal; pqxx::thread_safety_model pqxx::describe_thread_safety() noexcept { thread_safety_model model; if (PQisthreadsafe()) { model.safe_libpq = true; } else { model.safe_libpq = false; model.description += "Using a libpq build that is not thread-safe.\n"; } // Sadly I'm not aware of any way to avoid this just yet. model.safe_kerberos = false; model.description += "Kerberos is not thread-safe. If your application uses Kerberos, " "protect all calls to Kerberos or libpqxx using a global lock.\n"; return model; } std::string pqxx::internal::namedclass::description() const { try { std::string desc = classname(); if (not name().empty()) desc += " '" + name() + "'"; return desc; } catch (const std::exception &) { // Oops, string composition failed! Probably out of memory. // Let's try something easier. } return name().empty() ? classname() : name(); } void pqxx::internal::CheckUniqueRegistration(const namedclass *New, const namedclass *Old) { if (New == nullptr) throw internal_error{"null pointer registered."}; if (Old) { if (Old == New) throw usage_error{"Started twice: " + New->description()}; throw usage_error{ "Started " + New->description() + " while " + Old->description() + " still active."}; } } void pqxx::internal::CheckUniqueUnregistration(const namedclass *New, const namedclass *Old) { if (New != Old) { if (New == nullptr) throw usage_error{ "Expected to close " + Old->description() + ", " "but got null pointer instead."}; if (Old == nullptr) throw usage_error{"Closed while not open: " + New->description()}; throw usage_error{ "Closed " + New->description() + "; " "expected to close " + Old->description()}; } } void pqxx::internal::freepqmem(const void *p) noexcept { PQfreemem(const_cast(p)); } void pqxx::internal::freemallocmem(const void *p) noexcept { free(const_cast(p)); } void pqxx::internal::sleep_seconds(int s) { std::this_thread::sleep_for(std::chrono::seconds(s)); } libpqxx-6.4.5/src/version.cxx000066400000000000000000000006431350065432700162250ustar00rootroot00000000000000#include "pqxx/compiler-internal.hxx" #include "pqxx/version" namespace pqxx { namespace internal { // One, single definition of this function. If a call fails to link, then the // libpqxx binary was built against a different libpqxx version than the code // which is being linked against it. template<> PQXX_LIBEXPORT int check_library_version() noexcept { return 0; } } } libpqxx-6.4.5/test/000077500000000000000000000000001350065432700142015ustar00rootroot00000000000000libpqxx-6.4.5/test/CMakeLists.txt000066400000000000000000000036321350065432700167450ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './test/CMakeLists.txt.template'. ################################################################################ enable_testing() # TODO: We're giving exact filenames here. Don't pretend they're globs. file( GLOB TEST_SOURCES test00.cxx test01.cxx test02.cxx test04.cxx test07.cxx test10.cxx test11.cxx test12.cxx test13.cxx test14.cxx test15.cxx test16.cxx test17.cxx test18.cxx test20.cxx test21.cxx test23.cxx test26.cxx test29.cxx test30.cxx test31.cxx test32.cxx test33.cxx test34.cxx test35.cxx test36.cxx test37.cxx test39.cxx test46.cxx test48.cxx test49.cxx test50.cxx test51.cxx test52.cxx test53.cxx test54.cxx test55.cxx test56.cxx test57.cxx test58.cxx test59.cxx test60.cxx test61.cxx test62.cxx test63.cxx test64.cxx test65.cxx test66.cxx test67.cxx test69.cxx test70.cxx test71.cxx test72.cxx test73.cxx test74.cxx test75.cxx test76.cxx test77.cxx test78.cxx test79.cxx test82.cxx test84.cxx test86.cxx test87.cxx test88.cxx test89.cxx test90.cxx test92.cxx test93.cxx runner.cxx ) add_executable(runner ${TEST_SOURCES}) target_link_libraries(runner PUBLIC pqxx_shared) add_test(NAME runner WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND runner) add_subdirectory(unit) libpqxx-6.4.5/test/CMakeLists.txt.template000066400000000000000000000006511350065432700205550ustar00rootroot00000000000000enable_testing() # TODO: We're giving exact filenames here. Don't pretend they're globs. file( GLOB TEST_SOURCES ###MAKTEMPLATE:FOREACH test/test*.cxx ###BASENAME###.cxx ###MAKTEMPLATE:ENDFOREACH runner.cxx ) add_executable(runner ${TEST_SOURCES}) target_link_libraries(runner PUBLIC pqxx_shared) add_test(NAME runner WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND runner) add_subdirectory(unit) libpqxx-6.4.5/test/Makefile.am000066400000000000000000000052061350065432700162400ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './test/Makefile.am.template'. ################################################################################ # Makefile.am is generated automatically for automake whenever test programs are # added to libpqxx. SUBDIRS = unit EXTRA_DIST = Makefile.am.template # Use the serial test runner, so tests don't get run in parallel. Otherwise, # output from test failures will be hidden away in log files where we can't # see them when running in a build slave. AUTOMAKE_OPTIONS=serial-tests AM_CPPFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include # Override automatically generated list of default includes. It contains only # unnecessary entries, and incorrectly mentions include/pqxx directly. DEFAULT_INCLUDES= noinst_HEADERS = test_helpers.hxx test_main.hxx CLEANFILES=pqxxlo.txt MAINTAINERCLEANFILES=Makefile.in #TESTS_ENVIRONMENT=PGDATABASE=libpqxx # PGDATABASE, PGHOST, PGPORT, PGUSER runner_SOURCES = \ test00.cxx \ test01.cxx \ test02.cxx \ test04.cxx \ test07.cxx \ test10.cxx \ test11.cxx \ test12.cxx \ test13.cxx \ test14.cxx \ test15.cxx \ test16.cxx \ test17.cxx \ test18.cxx \ test20.cxx \ test21.cxx \ test23.cxx \ test26.cxx \ test29.cxx \ test30.cxx \ test31.cxx \ test32.cxx \ test33.cxx \ test34.cxx \ test35.cxx \ test36.cxx \ test37.cxx \ test39.cxx \ test46.cxx \ test48.cxx \ test49.cxx \ test50.cxx \ test51.cxx \ test52.cxx \ test53.cxx \ test54.cxx \ test55.cxx \ test56.cxx \ test57.cxx \ test58.cxx \ test59.cxx \ test60.cxx \ test61.cxx \ test62.cxx \ test63.cxx \ test64.cxx \ test65.cxx \ test66.cxx \ test67.cxx \ test69.cxx \ test70.cxx \ test71.cxx \ test72.cxx \ test73.cxx \ test74.cxx \ test75.cxx \ test76.cxx \ test77.cxx \ test78.cxx \ test79.cxx \ test82.cxx \ test84.cxx \ test86.cxx \ test87.cxx \ test88.cxx \ test89.cxx \ test90.cxx \ test92.cxx \ test93.cxx \ runner.cxx runner_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} TESTS = runner check_PROGRAMS = ${TESTS} # ###MAKTEMPLATE:FOREACH test/test*.cxx # ###BASENAME###_SOURCES = ###BASENAME###.cxx # ###BASENAME###_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} libpqxx-6.4.5/test/Makefile.am.template000066400000000000000000000022301350065432700200440ustar00rootroot00000000000000# Makefile.am is generated automatically for automake whenever test programs are # added to libpqxx. SUBDIRS = unit EXTRA_DIST = Makefile.am.template # Use the serial test runner, so tests don't get run in parallel. Otherwise, # output from test failures will be hidden away in log files where we can't # see them when running in a build slave. AUTOMAKE_OPTIONS=serial-tests AM_CPPFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include # Override automatically generated list of default includes. It contains only # unnecessary entries, and incorrectly mentions include/pqxx directly. DEFAULT_INCLUDES= noinst_HEADERS = test_helpers.hxx test_main.hxx CLEANFILES=pqxxlo.txt MAINTAINERCLEANFILES=Makefile.in #TESTS_ENVIRONMENT=PGDATABASE=libpqxx # PGDATABASE, PGHOST, PGPORT, PGUSER runner_SOURCES = \ ###MAKTEMPLATE:FOREACH test/test*.cxx ###BASENAME###.cxx \ ###MAKTEMPLATE:ENDFOREACH runner.cxx runner_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} TESTS = runner check_PROGRAMS = ${TESTS} # ###MAKTEMPLATE:FOREACH test/test*.cxx # ###BASENAME###_SOURCES = ###BASENAME###.cxx # ###BASENAME###_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} libpqxx-6.4.5/test/Makefile.in000066400000000000000000001040201350065432700162430ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = runner$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = runner$(EXEEXT) am_runner_OBJECTS = test00.$(OBJEXT) test01.$(OBJEXT) test02.$(OBJEXT) \ test04.$(OBJEXT) test07.$(OBJEXT) test10.$(OBJEXT) \ test11.$(OBJEXT) test12.$(OBJEXT) test13.$(OBJEXT) \ test14.$(OBJEXT) test15.$(OBJEXT) test16.$(OBJEXT) \ test17.$(OBJEXT) test18.$(OBJEXT) test20.$(OBJEXT) \ test21.$(OBJEXT) test23.$(OBJEXT) test26.$(OBJEXT) \ test29.$(OBJEXT) test30.$(OBJEXT) test31.$(OBJEXT) \ test32.$(OBJEXT) test33.$(OBJEXT) test34.$(OBJEXT) \ test35.$(OBJEXT) test36.$(OBJEXT) test37.$(OBJEXT) \ test39.$(OBJEXT) test46.$(OBJEXT) test48.$(OBJEXT) \ test49.$(OBJEXT) test50.$(OBJEXT) test51.$(OBJEXT) \ test52.$(OBJEXT) test53.$(OBJEXT) test54.$(OBJEXT) \ test55.$(OBJEXT) test56.$(OBJEXT) test57.$(OBJEXT) \ test58.$(OBJEXT) test59.$(OBJEXT) test60.$(OBJEXT) \ test61.$(OBJEXT) test62.$(OBJEXT) test63.$(OBJEXT) \ test64.$(OBJEXT) test65.$(OBJEXT) test66.$(OBJEXT) \ test67.$(OBJEXT) test69.$(OBJEXT) test70.$(OBJEXT) \ test71.$(OBJEXT) test72.$(OBJEXT) test73.$(OBJEXT) \ test74.$(OBJEXT) test75.$(OBJEXT) test76.$(OBJEXT) \ test77.$(OBJEXT) test78.$(OBJEXT) test79.$(OBJEXT) \ test82.$(OBJEXT) test84.$(OBJEXT) test86.$(OBJEXT) \ test87.$(OBJEXT) test88.$(OBJEXT) test89.$(OBJEXT) \ test90.$(OBJEXT) test92.$(OBJEXT) test93.$(OBJEXT) \ runner.$(OBJEXT) runner_OBJECTS = $(am_runner_OBJECTS) am__DEPENDENCIES_1 = runner_DEPENDENCIES = $(top_builddir)/src/libpqxx.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(runner_SOURCES) DIST_SOURCES = $(runner_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ ################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './test/Makefile.am.template'. ################################################################################ # Makefile.am is generated automatically for automake whenever test programs are # added to libpqxx. SUBDIRS = unit EXTRA_DIST = Makefile.am.template # Use the serial test runner, so tests don't get run in parallel. Otherwise, # output from test failures will be hidden away in log files where we can't # see them when running in a build slave. AUTOMAKE_OPTIONS = serial-tests AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include # Override automatically generated list of default includes. It contains only # unnecessary entries, and incorrectly mentions include/pqxx directly. DEFAULT_INCLUDES = noinst_HEADERS = test_helpers.hxx test_main.hxx CLEANFILES = pqxxlo.txt MAINTAINERCLEANFILES = Makefile.in #TESTS_ENVIRONMENT=PGDATABASE=libpqxx # PGDATABASE, PGHOST, PGPORT, PGUSER runner_SOURCES = \ test00.cxx \ test01.cxx \ test02.cxx \ test04.cxx \ test07.cxx \ test10.cxx \ test11.cxx \ test12.cxx \ test13.cxx \ test14.cxx \ test15.cxx \ test16.cxx \ test17.cxx \ test18.cxx \ test20.cxx \ test21.cxx \ test23.cxx \ test26.cxx \ test29.cxx \ test30.cxx \ test31.cxx \ test32.cxx \ test33.cxx \ test34.cxx \ test35.cxx \ test36.cxx \ test37.cxx \ test39.cxx \ test46.cxx \ test48.cxx \ test49.cxx \ test50.cxx \ test51.cxx \ test52.cxx \ test53.cxx \ test54.cxx \ test55.cxx \ test56.cxx \ test57.cxx \ test58.cxx \ test59.cxx \ test60.cxx \ test61.cxx \ test62.cxx \ test63.cxx \ test64.cxx \ test65.cxx \ test66.cxx \ test67.cxx \ test69.cxx \ test70.cxx \ test71.cxx \ test72.cxx \ test73.cxx \ test74.cxx \ test75.cxx \ test76.cxx \ test77.cxx \ test78.cxx \ test79.cxx \ test82.cxx \ test84.cxx \ test86.cxx \ test87.cxx \ test88.cxx \ test89.cxx \ test90.cxx \ test92.cxx \ test93.cxx \ runner.cxx runner_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} all: all-recursive .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list runner$(EXEEXT): $(runner_OBJECTS) $(runner_DEPENDENCIES) $(EXTRA_runner_DEPENDENCIES) @rm -f runner$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(runner_OBJECTS) $(runner_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test00.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test02.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test04.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test07.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test10.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test11.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test12.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test13.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test14.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test15.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test17.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test18.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test20.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test21.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test23.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test26.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test29.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test30.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test31.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test33.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test34.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test35.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test36.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test37.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test39.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test46.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test48.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test49.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test50.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test51.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test52.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test53.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test54.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test55.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test56.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test57.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test58.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test59.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test60.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test61.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test62.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test63.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test65.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test66.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test67.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test69.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test70.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test71.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test72.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test73.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test74.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test75.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test76.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test77.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test78.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test79.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test82.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test84.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test86.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test87.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test88.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test89.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test90.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test92.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test93.Po@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-TESTS check-am clean clean-checkPROGRAMS clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # ###MAKTEMPLATE:FOREACH test/test*.cxx # ###BASENAME###_SOURCES = ###BASENAME###.cxx # ###BASENAME###_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/test/runner.cxx000066400000000000000000000000311350065432700162300ustar00rootroot00000000000000#include "test_main.hxx" libpqxx-6.4.5/test/test00.cxx000066400000000000000000000117051350065432700160500ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Initial test program for libpqxx. Test functionality that doesn't require a // running database. namespace { void check(std::string ref, std::string val, std::string vdesc) { PQXX_CHECK_EQUAL(val, ref, "String mismatch for " + vdesc); } template inline void strconv( std::string type, const T &Obj, std::string expected) { const std::string Objstr{to_string(Obj)}; check(expected, Objstr, type); T NewObj; from_string(Objstr, NewObj); check(expected, to_string(NewObj), "recycled " + type); } // There's no from_string()... inline void strconv(std::string type, const char Obj[], std::string expected) { const std::string Objstr(to_string(Obj)); check(expected, Objstr, type); } const double not_a_number = std::numeric_limits::quiet_NaN(); struct intderef { intderef(){} // Silences bogus warning in some gcc versions template int operator()(ITER i) const noexcept { return int(*i); } }; void test_000() { PQXX_CHECK_EQUAL( oid_none, 0u, "InvalidIod is not zero as it used to be. This may conceivably " "cause problems in libpqxx."); PQXX_CHECK( cursor_base::prior() < 0 and cursor_base::backward_all() < 0, "cursor_base::difference_type appears to be unsigned."); const char weird[] = "foo\t\n\0bar"; const std::string weirdstr(weird, sizeof(weird)-1); // Test string conversions strconv("const char[]", "", ""); strconv("const char[]", "foo", "foo"); strconv("int", 0, "0"); strconv("int", 100, "100"); strconv("int", -1, "-1"); #if defined(_MSC_VER) const long long_min = LONG_MIN, long_max = LONG_MAX; #else const long long_min = std::numeric_limits::min(), long_max = std::numeric_limits::max(); #endif std::stringstream lminstr, lmaxstr, llminstr, llmaxstr, ullmaxstr; lminstr.imbue(std::locale("C")); lmaxstr.imbue(std::locale("C")); llminstr.imbue(std::locale("C")); llmaxstr.imbue(std::locale("C")); ullmaxstr.imbue(std::locale("C")); lminstr << long_min; lmaxstr << long_max; const auto ullong_max = std::numeric_limits::max(); const auto llong_max = std::numeric_limits::max(), llong_min = std::numeric_limits::min(); llminstr << llong_min; llmaxstr << llong_max; ullmaxstr << ullong_max; strconv("long", 0, "0"); strconv("long", long_min, lminstr.str()); strconv("long", long_max, lmaxstr.str()); strconv("double", not_a_number, "nan"); strconv("string", std::string{}, ""); strconv("string", weirdstr, weirdstr); strconv("long long", 0LL, "0"); strconv("long long", llong_min, llminstr.str()); strconv("long long", llong_max, llmaxstr.str()); strconv("unsigned long long", 0ULL, "0"); strconv("unsigned long long", ullong_max, ullmaxstr.str()); const char zerobuf[] = "0"; std::string zero; from_string(zerobuf, zero, sizeof(zerobuf)-1); PQXX_CHECK_EQUAL( zero, zerobuf, "Converting \"0\" with explicit length failed."); const char nulbuf[] = "\0string\0with\0nuls\0"; const std::string nully(nulbuf, sizeof(nulbuf)-1); std::string nully_parsed; from_string(nulbuf, nully_parsed, sizeof(nulbuf)-1); PQXX_CHECK_EQUAL(nully_parsed.size(), nully.size(), "Nul truncates string."); PQXX_CHECK_EQUAL(nully_parsed, nully, "String conversion breaks on nuls."); from_string(nully.c_str(), nully_parsed, nully.size()); PQXX_CHECK_EQUAL(nully_parsed, nully, "Nul conversion breaks on strings."); std::stringstream ss; strconv("empty stringstream", ss, ""); ss << -3.1415; strconv("stringstream", ss, ss.str()); // TODO: Test binarystring reversibility const std::string pw = encrypt_password("foo", "bar"); PQXX_CHECK(not pw.empty(), "Encrypting a password returned no data."); PQXX_CHECK_NOT_EQUAL( pw, encrypt_password("splat", "blub"), "Password encryption is broken."); PQXX_CHECK( pw.find("bar") == std::string::npos, "Encrypted password contains original."); // Test error handling for failed connections { nullconnection nc; PQXX_CHECK_THROWS( work w(nc), broken_connection, "nullconnection fails to fail."); } { nullconnection nc(""); PQXX_CHECK_THROWS( work w(nc), broken_connection, "nullconnection(const char[]) is broken."); } { std::string n; nullconnection nc(n); PQXX_CHECK_THROWS( work w(nc), broken_connection, "nullconnection(const string &) is broken."); } // Now that we know nullconnections throw errors as expected, test // pqxx_exception. try { nullconnection nc; work w(nc); } catch (const pqxx_exception &e) { PQXX_CHECK( dynamic_cast(&e.base()), "Downcast pqxx_exception is not a broken_connection"); pqxx::test::expected_exception(e.base().what()); PQXX_CHECK_EQUAL( dynamic_cast(e.base()).what(), e.base().what(), "Inconsistent what() message in exception."); } } PQXX_REGISTER_TEST(test_000); } // namespace libpqxx-6.4.5/test/test01.cxx000066400000000000000000000023741350065432700160530ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; namespace { // Simple test program for libpqxx. Open connection to database, start // a transaction, and perform a query inside it. void test_001() { connection conn; std::cout << "Connected to database." << std::endl << "Backend version: " << conn.server_version() << std::endl << "Protocol version: " << conn.protocol_version() << std::endl; // Begin a transaction acting on our current connection. Give it a human- // readable name so the library can include it in error messages. work tx{conn, "test1"}; // Perform a query on the database, storing result rows in R. result r( tx.exec("SELECT * FROM pg_tables") ); // We're expecting to find some tables... PQXX_CHECK(not r.empty(), "No tables found. Cannot test."); // Process each successive result row for (const auto &c: r) { // Dump row number and column 0 value to cout. Read the value using // as(), which converts the field to the same type as the default value // you give it (or returns the default value if the field is null). std::cout << '\t' << to_string(c.num()) << '\t' << c[0].as(std::string{}) << std::endl; } tx.commit(); } PQXX_REGISTER_TEST(test_001); } // namespace libpqxx-6.4.5/test/test02.cxx000066400000000000000000000045541350065432700160560ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Example/test program for libpqxx. Perform a query and enumerate its output // using array indexing. namespace { void bad_connect() { connection conn{"totally#invalid@connect$string!?"}; } void test_002() { // Before we really connect, test the expected behaviour of the default // connection type, where a failure to connect results in an immediate // exception rather than a silent retry. PQXX_CHECK_THROWS_EXCEPTION( bad_connect(), "Invalid connection string did not cause exception."); // Set up connection to database std::string ConnectString = ""; connection C{ConnectString}; // Start transaction within context of connection work T{C, "test2"}; // Perform query within transaction result R( T.exec("SELECT * FROM pg_tables") ); // Let's keep the database waiting as briefly as possible: commit now, // before we start processing results. We could do this later, or since // we're not making any changes in the database that need to be committed, // we could in this case even omit it altogether. T.commit(); // Since we don't need the database anymore, we can be even more // considerate and close the connection now. This is optional. C.disconnect(); // Ah, this version of postgres will tell you which table a column in a // result came from. Let's just test that functionality... const oid rtable = R.column_table(0); PQXX_CHECK_EQUAL( rtable, R.column_table(pqxx::row::size_type(0)), "Inconsistent answers from column_table()"); const std::string rcol = R.column_name(0); const oid crtable = R.column_table(rcol); PQXX_CHECK_EQUAL( crtable, rtable, "Field looked up by name gives different origin."); // Now we've got all that settled, let's process our results. for (result::size_type i = 0; i < R.size(); ++i) { const oid ftable = R[i][0].table(); PQXX_CHECK_EQUAL(ftable, rtable, "field::table() is broken."); const oid ttable = R[i].column_table(0); PQXX_CHECK_EQUAL( ttable, R[i].column_table(pqxx::row::size_type(0)), "Inconsistent pqxx::row::column_table()."); PQXX_CHECK_EQUAL(ttable, rtable, "Inconsistent result::column_table()."); const oid cttable = R[i].column_table(rcol); PQXX_CHECK_EQUAL( cttable, rtable, "pqxx::row::column_table() is broken."); } } PQXX_REGISTER_TEST(test_002); } // namespace libpqxx-6.4.5/test/test04.cxx000066400000000000000000000030221350065432700160450ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Send notification to self. namespace { int Backend_PID = 0; // Sample implementation of notification receiver. class TestListener final : public notification_receiver { bool m_done; public: explicit TestListener(connection_base &conn) : notification_receiver(conn, "listen"), m_done(false) {} virtual void operator()(const std::string &, int be_pid) override { m_done = true; PQXX_CHECK_EQUAL( be_pid, Backend_PID, "Notification came from wrong backend process."); } bool done() const { return m_done; } }; void test_004() { connection conn; TestListener L{conn}; // Trigger our notification receiver. perform( [&conn, &L]() { work tx(conn); tx.exec("NOTIFY " + conn.quote_name(L.channel())); Backend_PID = conn.backendpid(); tx.commit(); }); int notifs = 0; for (int i=0; (i < 20) and not L.done(); ++i) { PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notifications."); // Sleep one second using a libpqxx-internal function. Kids, don't try // this at home! The pqxx::internal namespace is not for third-party use // and may change radically at any time. pqxx::internal::sleep_seconds(1); notifs = conn.get_notifs(); } PQXX_CHECK_NOT_EQUAL(L.done(), false, "No notification received."); PQXX_CHECK_EQUAL(notifs, 1, "Got too many notifications."); } PQXX_REGISTER_TEST(test_004); } // namespace libpqxx-6.4.5/test/test07.cxx000066400000000000000000000104271350065432700160570ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Modify the database, retaining transactional // integrity using the transactor framework. // // This assumes the existence of a database table "pqxxevents" containing a // 2-digit "year" field, which is extended to a 4-digit format by assuming all // year numbers of 70 or higher are in the 20th century, and all others in the // 21st, and that no years before 1970 are possible. namespace { // Convert year to 4-digit format. int To4Digits(int Y) { int Result = Y; PQXX_CHECK(Y >= 0, "Negative year: " + to_string(Y)); if (Y < 70) Result += 2000; else if (Y < 100) Result += 1900; else if (Y < 1970) PQXX_CHECK_NOTREACHED("Unexpected year: " + to_string(Y)); return Result; } void test_007() { connection conn; conn.set_client_encoding("SQL_ASCII"); { work tx{conn}; test::create_pqxxevents(tx); tx.commit(); } // Perform (an instantiation of) the UpdateYears transactor we've defined // in the code above. This is where the work gets done. std::map conversions; perform( [&conversions, &conn]() { work tx{conn}; // First select all different years occurring in the table. result R(tx.exec("SELECT year FROM pqxxevents")); // See if we get reasonable type identifier for this column. const oid rctype = R.column_type(0); PQXX_CHECK_EQUAL( R.column_type(pqxx::row::size_type(0)), rctype, "Inconsistent result::column_type()."); const std::string rct = to_string(rctype); PQXX_CHECK(rctype > 0, "Got strange type ID for column: " + rct); const std::string rcol = R.column_name(0); PQXX_CHECK(not rcol.empty(), "Didn't get a name for column."); const oid rcctype = R.column_type(rcol); PQXX_CHECK_EQUAL( rcctype, rctype, "Column type is not what it is by name."); const oid rawrcctype = R.column_type(rcol.c_str()); PQXX_CHECK_EQUAL( rawrcctype, rctype, "Column type by C-style name is different."); // Note all different years currently occurring in the table, writing // them and their correct mappings to conversions. for (const auto &r: R) { int Y; // Read year, and if it is non-null, note its converted value if (r[0] >> Y) conversions[Y] = To4Digits(Y); // See if type identifiers are consistent const oid tctype = r.column_type(0); PQXX_CHECK_EQUAL( tctype, r.column_type(pqxx::row::size_type(0)), "Inconsistent pqxx::row::column_type()"); PQXX_CHECK_EQUAL( tctype, rctype, "pqxx::row::column_type() is inconsistent with " "result::column_type()."); const oid ctctype = r.column_type(rcol); PQXX_CHECK_EQUAL( ctctype, rctype, "Column type lookup by column name is broken."); const oid rawctctype = r.column_type(rcol.c_str()); PQXX_CHECK_EQUAL( rawctctype, rctype, "Column type lookup by C-style name is broken."); const oid fctype = r[0].type(); PQXX_CHECK_EQUAL( fctype, rctype, "Field type lookup is broken."); } result::size_type AffectedRows = 0; // For each occurring year, write converted date back to whereever it may // occur in the table. Since we're in a transaction, any changes made by // others at the same time will not affect us. for (const auto &c: conversions) { const auto query = "UPDATE pqxxevents " "SET year=" + to_string(c.second) + " " "WHERE year=" + to_string(c.first); R = tx.exec0(query.c_str()); AffectedRows += R.affected_rows(); } std::cout << AffectedRows << " rows updated." << std::endl; }); // Just for fun, report the exact conversions performed. Note that this // list will be accurate even if other people were modifying the database // at the same time; this property was established through use of the // transactor framework. for (auto &i: conversions) std::cout << '\t' << i.first << "\t-> " << i.second << std::endl; } PQXX_REGISTER_TEST(test_007); } // namespace libpqxx-6.4.5/test/test10.cxx000066400000000000000000000057221350065432700160530ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Open connection to database, start a transaction, // abort it, and verify that it "never happened." namespace { // Let's take a boring year that is not going to be in the "pqxxevents" table const int BoringYear = 1977; const std::string Table("pqxxevents"); // Count events, and boring events, in table std::pair CountEvents(transaction_base &T) { const std::string EventsQuery = "SELECT count(*) FROM " + Table; const std::string BoringQuery = EventsQuery + " WHERE year=" + to_string(BoringYear); int EventsCount = 0, BoringCount = 0; row R( T.exec1(EventsQuery) ); R.front().to(EventsCount); R = T.exec1(BoringQuery); R.front().to(BoringCount); return std::make_pair(EventsCount, BoringCount); } // Try adding a record, then aborting it, and check whether the abort was // performed correctly. void Test(connection_base &C, bool ExplicitAbort) { std::pair EventCounts; // First run our doomed transaction. This will refuse to run if an event // exists for our Boring Year. { // Begin a transaction acting on our current connection; we'll abort it // later though. work Doomed{C, "Doomed"}; // Verify that our Boring Year was not yet in the events table EventCounts = CountEvents(Doomed); PQXX_CHECK_EQUAL( EventCounts.second, 0, "Can't run, boring year is already in table."); // Now let's try to introduce a row for our Boring Year Doomed.exec0( "INSERT INTO " + Table + "(year, event) " "VALUES (" + to_string(BoringYear) + ", 'yawn')"); const auto Recount = CountEvents(Doomed); PQXX_CHECK_EQUAL( Recount.second, 1, "Wrong # events for " + to_string(BoringYear)); PQXX_CHECK_EQUAL( Recount.first, EventCounts.first + 1, "Number of events changed."); // Okay, we've added an entry but we don't really want to. Abort it // explicitly if requested, or simply let the Transaction object "expire." if (ExplicitAbort) Doomed.abort(); // If now explicit abort requested, Doomed Transaction still ends here } // Now check that we're back in the original state. Note that this may go // wrong if somebody managed to change the table between our two // transactions. work Checkup(C, "Checkup"); const auto NewEvents = CountEvents(Checkup); PQXX_CHECK_EQUAL( NewEvents.first, EventCounts.first, "Number of events changed. This may be due to a bug in libpqxx, " "or the test table was modified by some other process."); PQXX_CHECK_EQUAL( NewEvents.second, 0, "Found unexpected events. This may be due to a bug in libpqxx, " "or the test table was modified by some other process."); } void test_abort() { connection conn; nontransaction t{conn}; test::create_pqxxevents(t); connection_base &c(t.conn()); t.commit(); Test(c, true); Test(c, false); } PQXX_REGISTER_TEST(test_abort); } // namespace libpqxx-6.4.5/test/test11.cxx000066400000000000000000000041641350065432700160530ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Query a table and report its metadata. namespace { void test_011() { connection conn; work tx{conn}; const std::string Table = "pg_tables"; result R( tx.exec("SELECT * FROM " + Table) ); // Print column names for (pqxx::row::size_type c = 0; c < R.columns(); ++c) { std::string N = R.column_name(c); std::cout << c << ":\t" << N << std::endl; PQXX_CHECK_EQUAL(R.column_number(N), c, "Inconsistent column numbers."); } // If there are rows in R, compare their metadata to R's. if (not R.empty()) { PQXX_CHECK_EQUAL(R[0].rownumber(), 0u, "Row 0 has wrong number."); if (R.size() < 2) std::cout << "(Only one row in table.)" << std::endl; else PQXX_CHECK_EQUAL(R[1].rownumber(), 1u, "Row 1 has wrong number."); // Test row::swap() const pqxx::row T1(R[0]), T2(R[1]); PQXX_CHECK_NOT_EQUAL(T1, T2, "Values are identical--can't test swap()."); pqxx::row T1s(T1), T2s(T2); PQXX_CHECK_EQUAL(T1s, T1, "Row copy-construction incorrect."); PQXX_CHECK_EQUAL(T2s, T2, "Row copy-construction inconsistently wrong."); T1s.swap(T2s); PQXX_CHECK_NOT_EQUAL(T1s, T1, "Row swap doesn't work."); PQXX_CHECK_NOT_EQUAL(T2s, T2, "Row swap inconsistently wrong."); PQXX_CHECK_EQUAL(T2s, T1, "Row swap is asymmetric."); PQXX_CHECK_EQUAL(T1s, T2, "Row swap is inconsistently asymmetric."); for (pqxx::row::size_type c = 0; c < R[0].size(); ++c) { std::string N = R.column_name(c); PQXX_CHECK_EQUAL( std::string{R[0].at(c).c_str()}, R[0].at(N).c_str(), "Field by name != field by number."); PQXX_CHECK_EQUAL( std::string{R[0][c].c_str()}, R[0][N].c_str(), "at() is inconsistent with operator[]."); PQXX_CHECK_EQUAL(R[0][c].name(), N, "Field names are inconsistent."); PQXX_CHECK_EQUAL( R[0][c].size(), strlen(R[0][c].c_str()), "Field size is not what we expected."); } } else { std::cout << "(Table is empty.)" << std::endl; } } PQXX_REGISTER_TEST(test_011); } // namespace libpqxx-6.4.5/test/test12.cxx000066400000000000000000000074621350065432700160600ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. See which fields in a query are null, and figure // out whether any fields are lexicographically sorted. namespace { void test_012() { connection conn; const std::string Table = "pg_tables"; #include // Tell C we won't be needing it for a while (not true, but let's pretend) conn.deactivate(); // ...And reactivate C (not really needed, but it sounds more polite) conn.activate(); #include work tx{conn, "test12"}; result R( tx.exec("SELECT * FROM " + Table) ); // Map column to no. of null fields. std::vector NullFields(R.columns(), 0); // Does column appear to be sorted? std::vector SortedUp(R.columns(), true), SortedDown(R.columns(), true); for (auto i = R.begin(); i != R.end(); i++) { PQXX_CHECK_EQUAL( (*i).rownumber(), i->rownumber(), "Inconsistent row numbers for operator*() and operator->()."); PQXX_CHECK_EQUAL(i->size(), R.columns(), "Inconsistent row size."); // Look for null fields for (pqxx::row::size_type f=0; fsize(); ++f) { NullFields[f] += i.at(f).is_null(); std::string A, B; PQXX_CHECK_EQUAL( i[f].to(A), i[f].to(B, std::string{}), "Variants of to() disagree on nullness."); PQXX_CHECK_EQUAL(A, B, "Inconsistent field contents."); } // Compare fields to those of preceding row if (i != R.begin()) { const auto j = i - 1; // First perform some sanity checks on j vs. i and how libpqxx handles // their interrelationship... PQXX_CHECK_EQUAL(i - j, 1, "Iterator is wrong distance from successor."); PQXX_CHECK(not (j == i), "Iterator equals its successor."); PQXX_CHECK(j != i, "Iterator inequality is inconsistent."); PQXX_CHECK(not (j >= i), "Iterator doesn't come before its successor."); PQXX_CHECK(not (j > i), "Iterator is preceded by its successor."); PQXX_CHECK(not (i <= j), "Iterator doesn't come after its predecessor."); PQXX_CHECK(not (i < j), "Iterator is succeded by its predecessor."); PQXX_CHECK(j <= i, "operator<=() doesn't mirror operator>=()."); PQXX_CHECK(j < i, "operator<() doesn't mirror operator>()."); PQXX_CHECK_EQUAL(1 + j, i, "Adding 1 doesn't reach successor."); result::const_iterator k(i); PQXX_CHECK_EQUAL(k--, i, "Post-increment returns wrong iterator."); PQXX_CHECK_EQUAL(k, j, "Bad iterator position after post-increment."); result::const_iterator l(i); PQXX_CHECK_EQUAL(--l, j, "Pre-increment returns wrong iterator."); PQXX_CHECK_EQUAL(l, j, "Pre-increment sets wrong iterator position."); PQXX_CHECK_EQUAL(k += 1, i, "Wrong return value from +=."); PQXX_CHECK_EQUAL(k, i, "Bad iterator position after +=."); PQXX_CHECK_EQUAL(k -= 1, j, "Wrong return value from -=."); PQXX_CHECK_EQUAL(k, j, "Bad iterator position after -=."); // ...Now let's do meaningful stuff with j, such as finding out which // fields may be sorted. Don't do anything fancy like trying to // detect numbers and comparing them as such, just compare them as // simple strings. for (pqxx::row::size_type f = 0; f < R.columns(); ++f) { if (not j[f].is_null()) { const bool U = SortedUp[f], D = SortedDown[f]; SortedUp[f] = U & ( std::string{j[f].c_str()} <= std::string{i[f].c_str()}); SortedDown[f] = D & ( std::string{j[f].c_str()} >= std::string{i[f].c_str()}); } } } } for (pqxx::row::size_type f = 0; f < R.columns(); ++f) PQXX_CHECK( NullFields[f] <= int(R.size()), "Found more nulls than there were rows."); } PQXX_REGISTER_TEST(test_012); } // namespace libpqxx-6.4.5/test/test13.cxx000066400000000000000000000044061350065432700160540ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Verify abort behaviour of transactor. // // The program will attempt to add an entry to a table called "pqxxevents", // with a key column called "year"--and then abort the change. // // Note for the superstitious: the numbering for this test program is pure // coincidence. namespace { // Let's take a boring year that is not going to be in the "pqxxevents" table const unsigned int BoringYear = 1977; // Count events and specifically events occurring in Boring Year, leaving the // former count in the result pair's first member, and the latter in second. std::pair count_events(connection_base &conn, std::string table) { int all_years, boring_year; const std::string CountQuery = "SELECT count(*) FROM " + table; work tx{conn}; row R; R = tx.exec1(CountQuery); R.front().to(all_years); R = tx.exec1(CountQuery + " WHERE year=" + to_string(BoringYear)); R.front().to(boring_year); return std::make_pair(all_years, boring_year); } struct deliberate_error : std::exception { }; void failed_insert(connection_base &C, std::string table) { work tx(C); result R = tx.exec0( "INSERT INTO " + table + " VALUES (" + to_string(BoringYear) + ", " "'yawn')"); PQXX_CHECK_EQUAL(R.affected_rows(), 1u, "Bad affected_rows()."); throw deliberate_error(); } void test_013() { connection conn; { work tx{conn}; test::create_pqxxevents(tx); tx.commit(); } const std::string Table = "pqxxevents"; const std::pair Before = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL( Before.second, 0, "Already have event for " + to_string(BoringYear) + "--can't test."); quiet_errorhandler d(conn); PQXX_CHECK_THROWS( perform(std::bind(failed_insert, std::ref(conn), Table)), deliberate_error, "Failing transactor failed to throw correct exception."); const std::pair After = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL( After.first, Before.first, "abort() didn't reset event count."); PQXX_CHECK_EQUAL( After.second, Before.second, "abort() didn't reset event count for " + to_string(BoringYear)); } PQXX_REGISTER_TEST(test_013); } // namespace libpqxx-6.4.5/test/test14.cxx000066400000000000000000000021221350065432700160460ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test nontransaction. namespace { void test_014() { connection conn; // Begin a "non-transaction" acting on our current connection. This is // really all the transactional integrity we need since we're only // performing one query which does not modify the database. nontransaction tx{conn, "test14"}; // The transaction class family also has process_notice() functions. // These simply pass the notice through to their connection, but this may // be more convenient in some cases. All process_notice() functions accept // C++ strings as well as C strings. tx.process_notice(std::string{"Started nontransaction\n"}); result r{ tx.exec("SELECT * FROM pg_tables") }; for (const auto &c: r) { std::string n; c[0].to(n); std::cout << '\t' << to_string(c.num()) << '\t' << n << std::endl; } // "Commit" the non-transaction. This doesn't really do anything since // nontransaction doesn't start a backend transaction. tx.commit(); } PQXX_REGISTER_TEST(test_014); } // namespace libpqxx-6.4.5/test/test15.cxx000066400000000000000000000013001350065432700160440ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Open connection to database, start // a dummy transaction to gain nontransactional access, and perform a query. namespace { void test_015() { connection conn; // See if deactivate() behaves... #include conn.deactivate(); #include perform( [&conn]() { nontransaction tx{conn}; const auto r = tx.exec("SELECT * FROM generate_series(1, 5)"); PQXX_CHECK_EQUAL(r.size(), 5ul, "Weird query result."); tx.commit(); }); } PQXX_REGISTER_TEST(test_015); } // namespace libpqxx-6.4.5/test/test16.cxx000066400000000000000000000020061350065432700160510ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test robusttransaction. namespace { void test_016() { connection conn; robusttransaction<> tx{conn}; result R{ tx.exec("SELECT * FROM pg_tables") }; result::const_iterator c; for (c = R.begin(); c != R.end(); ++c) { std::string N; c[0].to(N); std::cout << '\t' << to_string(c.num()) << '\t' << N << std::endl; } // See if back() and row comparison work properly PQXX_CHECK(R.size() >= 2, "Not enough rows in pg_tables to test, sorry!"); --c; PQXX_CHECK_EQUAL( c->size(), R.back().size(), "Size mismatch between row iterator and back()."); const std::string nullstr; for (pqxx::row::size_type i = 0; i < c->size(); ++i) PQXX_CHECK_EQUAL( c[i].as(nullstr), R.back()[i].as(nullstr), "Value mismatch in back()."); PQXX_CHECK(c == R.back(), "Row equality is broken."); PQXX_CHECK(not (c != R.back()), "Row inequality is broken."); tx.commit(); } PQXX_REGISTER_TEST(test_016); } // namespace libpqxx-6.4.5/test/test17.cxx000066400000000000000000000010351350065432700160530ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Open connection to database, start // a dummy transaction to gain nontransactional access, and perform a query. namespace { void test_017() { connection conn; perform( [&conn]() { nontransaction tx{conn}; const auto r = tx.exec("SELECT * FROM generate_series(1, 4)"); PQXX_CHECK_EQUAL(r.size(), 4ul, "Weird query result."); tx.commit(); }); } PQXX_REGISTER_TEST(test_017); } // namespace libpqxx-6.4.5/test/test18.cxx000066400000000000000000000041441350065432700160600ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Verify abort behaviour of RobustTransaction. // // The program will attempt to add an entry to a table called "pqxxevents", // with a key column called "year"--and then abort the change. namespace { // Let's take a boring year that is not going to be in the "pqxxevents" table const long BoringYear = 1977; // Count events and specifically events occurring in Boring Year, leaving the // former count in the result pair's first member, and the latter in second. std::pair count_events(connection_base &conn, std::string table) { nontransaction tx{conn}; const std::string CountQuery = "SELECT count(*) FROM " + table; int all_years, boring_year; row R; R = tx.exec1(CountQuery); R.front().to(all_years); R = tx.exec1(CountQuery + " WHERE year=" + to_string(BoringYear)); R.front().to(boring_year); return std::make_pair(all_years, boring_year); } struct deliberate_error : std::exception { }; void test_018() { connection conn; { work tx{conn}; test::create_pqxxevents(tx); tx.commit(); } const std::string Table = "pqxxevents"; const std::pair Before = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL( Before.second, 0, "Already have event for " + to_string(BoringYear) + ", cannot run."); { quiet_errorhandler d{conn}; PQXX_CHECK_THROWS( perform( [&conn, Table]() { robusttransaction tx{conn}; tx.exec0( "INSERT INTO " + Table + " VALUES (" + to_string(BoringYear) + ", '" + tx.esc("yawn") + "')"); throw deliberate_error(); }), deliberate_error, "Not getting expected exception from failing transactor."); } const std::pair After = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL(After.first, Before.first, "Event count changed."); PQXX_CHECK_EQUAL( After.second, Before.second, "Event count for " + to_string(BoringYear) + " changed."); } PQXX_REGISTER_TEST(test_018); } // namespace libpqxx-6.4.5/test/test20.cxx000066400000000000000000000040301350065432700160430ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test: nontransaction changes are not rolled back on abort. namespace { const unsigned long BoringYear = 1977; void test_020() { connection conn; nontransaction t1{conn}; test::create_pqxxevents(t1); const std::string Table = "pqxxevents"; // Verify our start condition before beginning: there must not be a 1977 // record already. result R( t1.exec(("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)).c_str()) ); PQXX_CHECK_EQUAL( R.size(), 0u, "Already have a row for " + to_string(BoringYear) + ", cannot test."); // (Not needed, but verify that clear() works on empty containers) R.clear(); PQXX_CHECK(R.empty(), "result::clear() is broken."); // OK. Having laid that worry to rest, add a record for 1977. t1.exec0(("INSERT INTO " + Table + " VALUES" "(" + to_string(BoringYear) + "," "'Yawn'" ")").c_str()); // Abort T1. Since T1 is a nontransaction, which provides only the // transaction class interface without providing any form of transactional // integrity, this is not going to undo our work. t1.abort(); // Verify that our record was added, despite the Abort() nontransaction t2{conn, "t2"}; R = t2.exec(("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)).c_str()); PQXX_CHECK_EQUAL( R.size(), 1u, "Found wrong number of rows for " + to_string(BoringYear) + "."); PQXX_CHECK(R.capacity() >= R.size(), "Result's capacity is too small."); R.clear(); PQXX_CHECK(R.empty(), "result::clear() doesn't work."); // Now remove our record again t2.exec0(("DELETE FROM " + Table + " " "WHERE year=" + to_string(BoringYear)).c_str()); t2.commit(); // And again, verify results nontransaction t3{conn, "t3"}; R = t3.exec(("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)).c_str()); PQXX_CHECK_EQUAL(R.size(), 0u, "Record still found after removal."); } PQXX_REGISTER_TEST(test_020); } // namespace libpqxx-6.4.5/test/test21.cxx000066400000000000000000000033041350065432700160470ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Open a lazy connection to database, start // a transaction, and perform a query inside it. namespace { void test_021() { lazyconnection conn; conn.process_notice("Printing details on deferred connection\n"); const std::string HostName = (conn.hostname() ? conn.hostname() : ""); conn.process_notice(std::string{} + "database=" + conn.dbname() + ", " "username=" + conn.username() + ", " "hostname=" + HostName + ", " "port=" + to_string(conn.port()) + ", " "options='" + conn.options() + "', " "backendpid=" + to_string(conn.backendpid()) + "\n"); work tx{conn, "test_021"}; // By now our connection should really have been created conn.process_notice("Printing details on actual connection\n"); conn.process_notice(std::string{} + "database=" + conn.dbname() + ", " "username=" + conn.username() + ", " "hostname=" + HostName + ", " "port=" + to_string(conn.port()) + ", " "options='" + conn.options() + "', " "backendpid=" + to_string(conn.backendpid()) + "\n"); std::string P; from_string(conn.port(), P); PQXX_CHECK_EQUAL( P, to_string(conn.port()), "Port string conversion is broken."); PQXX_CHECK_EQUAL(to_string(P), P, "Port string conversion is broken."); result R( tx.exec("SELECT * FROM pg_tables") ); tx.process_notice(to_string(R.size()) + " " "result row in transaction " + tx.name() + "\n"); // Process each successive result row for (const auto &c: R) { std::string N; c[0].to(N); std::cout << '\t' << to_string(c.num()) << '\t' << N << std::endl; } tx.commit(); } PQXX_REGISTER_TEST(test_021); } // namespace libpqxx-6.4.5/test/test23.cxx000066400000000000000000000026601350065432700160550ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Send notification to self, using deferred // connection. namespace { // Sample implementation of notification receiver. class TestListener final : public notification_receiver { bool m_done; public: explicit TestListener(connection_base &C) : notification_receiver(C, "listen"), m_done(false) {} virtual void operator()(const std::string &, int be_pid) override { m_done = true; PQXX_CHECK_EQUAL( be_pid, conn().backendpid(), "Notification came from wrong backend process."); std::cout << "Received notification: " << channel() << " pid=" << be_pid << std::endl; } bool done() const { return m_done; } }; void test_023() { lazyconnection C; std::cout << "Adding listener..." << std::endl; TestListener L{C}; std::cout << "Sending notification..." << std::endl; perform([&C, &L](){ nontransaction{C}.exec("NOTIFY " + L.channel()); }); int notifs = 0; for (int i=0; (i < 20) and not L.done(); ++i) { PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notifications."); pqxx::internal::sleep_seconds(1); notifs = C.get_notifs(); std::cout << "."; } std::cout << std::endl; PQXX_CHECK(L.done(), "No notification received."); PQXX_CHECK_EQUAL(notifs, 1, "Unexpected number of notifications."); } PQXX_REGISTER_TEST(test_023); } // namespace libpqxx-6.4.5/test/test26.cxx000066400000000000000000000043631350065432700160620ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Modify the database, retaining transactional // integrity using the transactor framework, and using lazy connections. namespace { // Convert year to 4-digit format. int To4Digits(int Y) { int Result = Y; PQXX_CHECK(Y >= 0, "Negative year: " + to_string(Y)); if (Y < 70) Result += 2000; else if (Y < 100) Result += 1900; else PQXX_CHECK(Y >= 1970, "Unexpected year: " + to_string(Y)); return Result; } // Transaction definition for year-field update. Returns conversions done. std::map update_years(connection_base &C) { std::map conversions; work tx{C}; // First select all different years occurring in the table. result R{ tx.exec("SELECT year FROM pqxxevents") }; // Note all different years currently occurring in the table, writing them // and their correct mappings to m_conversions for (const auto &r: R) { int Y; // Read year, and if it is non-null, note its converted value if (r[0].to(Y)) conversions[Y] = To4Digits(Y); } // For each occurring year, write converted date back to whereever it may // occur in the table. Since we're in a transaction, any changes made by // others at the same time will not affect us. for (const auto &c: conversions) tx.exec0( "UPDATE pqxxevents " "SET year=" + to_string(c.second) + " " "WHERE year=" + to_string(c.first)); tx.commit(); return conversions; } void test_026() { lazyconnection conn; { nontransaction tx{conn}; test::create_pqxxevents(tx); tx.commit(); } // Perform (an instantiation of) the UpdateYears transactor we've defined // in the code above. This is where the work gets done. const auto conversions = perform(std::bind(update_years, std::ref(conn))); // Just for fun, report the exact conversions performed. Note that this // list will be accurate even if other people were modifying the database // at the same time; this property was established through use of the // transactor framework. for (const auto &i: conversions) std::cout << '\t' << i.first << "\t-> " << i.second << std::endl; } PQXX_REGISTER_TEST(test_026); } // namespace libpqxx-6.4.5/test/test29.cxx000066400000000000000000000060331350065432700160610ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Open connection to database, start a transaction, // abort it, and verify that it "never happened." Use lazy connection. // // The program will attempt to add an entry to a table called "pqxxevents", // with a key column called "year"--and then abort the change. namespace { // Let's take a boring year that is not going to be in the "pqxxevents" table const int BoringYear = 1977; const std::string Table = "pqxxevents"; // Count events, and boring events, in table std::pair CountEvents(transaction_base &T) { const std::string EventsQuery = "SELECT count(*) FROM " + Table; const std::string BoringQuery = EventsQuery + " WHERE year=" + to_string(BoringYear); int EventsCount = 0, BoringCount = 0; row R( T.exec1(EventsQuery) ); R.front().to(EventsCount); R = T.exec1(BoringQuery); R.front().to(BoringCount); return std::make_pair(EventsCount, BoringCount); } // Try adding a record, then aborting it, and check whether the abort was // performed correctly. void Test(connection_base &conn, bool ExplicitAbort) { std::vector BoringRow = {to_string(BoringYear), "yawn"}; std::pair EventCounts; // First run our doomed transaction. This will refuse to run if an event // exists for our Boring Year. { // Begin a transaction acting on our current connection; we'll abort it // later though. work Doomed(conn, "Doomed"); // Verify that our Boring Year was not yet in the events table EventCounts = CountEvents(Doomed); PQXX_CHECK_EQUAL( EventCounts.second, 0, "Can't run; " + to_string(BoringYear) + " is already in the table."); // Now let's try to introduce a row for our Boring Year Doomed.exec0( "INSERT INTO " + Table + "(year, event) " "VALUES (" + to_string(BoringYear) + ", 'yawn')"); auto Recount = CountEvents(Doomed); PQXX_CHECK_EQUAL(Recount.second, 1, "Unexpected number of events."); PQXX_CHECK_EQUAL( Recount.first, EventCounts.first+1, "Number of events changed."); // Okay, we've added an entry but we don't really want to. Abort it // explicitly if requested, or simply let the Transaction object "expire." if (ExplicitAbort) Doomed.abort(); // If now explicit abort requested, Doomed Transaction still ends here } // Now check that we're back in the original state. Note that this may go // wrong if somebody managed to change the table between our two // transactions. work Checkup(conn, "Checkup"); auto NewEvents = CountEvents(Checkup); PQXX_CHECK_EQUAL( NewEvents.first, EventCounts.first, "Wrong number of events."); PQXX_CHECK_EQUAL(NewEvents.second, 0, "Found unexpected events."); } void test_029() { lazyconnection conn; { nontransaction tx{conn}; test::create_pqxxevents(tx); } // Test abort semantics, both with explicit and implicit abort Test(conn, true); Test(conn, false); } PQXX_REGISTER_TEST(test_029); } // namespace libpqxx-6.4.5/test/test30.cxx000066400000000000000000000034461350065432700160560ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Query a table and report its metadata. Use lazy // connection. namespace { void test_030() { const std::string Table = "pg_tables"; lazyconnection conn; work tx{conn, "test30"}; result R( tx.exec(("SELECT * FROM " + Table).c_str()) ); PQXX_CHECK(not R.empty(), "Table " + Table + " is empty, cannot test."); // Print column names for (pqxx::row::size_type c = 0; c < R.columns(); ++c) { std::string N = R.column_name(c); std::cout << c << ":\t" << N << std::endl; PQXX_CHECK_EQUAL( R[0].column_number(N), R.column_number(N), "row::column_number() is inconsistent with result::column_number()."); PQXX_CHECK_EQUAL( R[0].column_number(N.c_str()), c, "Inconsistent column numbers."); } // If there are rows in R, compare their metadata to R's. if (R.empty()) { std::cout << "(Table is empty.)" << std::endl; return; } PQXX_CHECK_EQUAL(R[0].rownumber(), 0u, "Row 0 reports wrong number."); if (R.size() < 2) std::cout << "(Only one row in table.)" << std::endl; else PQXX_CHECK_EQUAL(R[1].rownumber(), 1u, "Row 1 reports wrong number."); for (pqxx::row::size_type c = 0; c < R[0].size(); ++c) { std::string N = R.column_name(c); PQXX_CHECK_EQUAL( std::string{R[0].at(c).c_str()}, R[0].at(N).c_str(), "Different field values by name and by number."); PQXX_CHECK_EQUAL( std::string{R[0][c].c_str()}, R[0][N].c_str(), "at() is inconsistent with operator[]."); PQXX_CHECK_EQUAL( R[0][c].name(), N, "Inconsistent field names."); PQXX_CHECK_EQUAL( R[0][c].size(), std::strlen(R[0][c].c_str()), "Inconsistent field lengths."); } } PQXX_REGISTER_TEST(test_030); } // namespace libpqxx-6.4.5/test/test31.cxx000066400000000000000000000111511350065432700160470ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. See which fields in a query are null, and figure // out whether any fields are lexicographically sorted. Use lazy connection. namespace { template void InitVector(VEC &V, typename VEC::size_type s, VAL val) { V.resize(s); for (auto i = V.begin(); i != V.end(); ++i) *i = val; } void test_031() { lazyconnection conn; const std::string Table = "pg_tables"; // Tell conn we won't be needing it for a while (not true, but let's pretend). #include conn.deactivate(); #include std::vector NullFields; // Maps column to no. of null fields std::vector SortedUp, SortedDown; // Does column appear to be sorted? // Reactivate conn (not really needed, but it sounds more polite). #include conn.activate(); #include work tx(conn, "test31"); result R( tx.exec("SELECT * FROM " + Table) ); InitVector(NullFields, R.columns(), 0); InitVector(SortedUp, R.columns(), true); InitVector(SortedDown, R.columns(), true); for (auto i = R.begin(); i != R.end(); i++) { PQXX_CHECK_EQUAL( (*i).rownumber(), i->rownumber(), "operator*() is inconsistent with operator->()."); PQXX_CHECK_EQUAL( i->size(), R.columns(), "Row size is inconsistent with result::columns()."); // Look for null fields for (pqxx::row::size_type f=0; fsize(); ++f) { NullFields[f] += i.at(f).is_null(); std::string A, B; PQXX_CHECK_EQUAL( i[f].to(A), i[f].to(B, std::string{}), "Variants of to() disagree on nullness."); PQXX_CHECK_EQUAL(A, B, "Variants of to() produce different values."); } // Compare fields to those of preceding row if (i != R.begin()) { const auto j = i - 1; // First perform some sanity checks on j vs. i and how libpqxx handles // their interrelationship... PQXX_CHECK_EQUAL(i - j, 1, "Iterator successor is at wrong distance."); PQXX_CHECK_NOT_EQUAL(j, i, "Iterator equals successor."); PQXX_CHECK(j != i, "Iterator is not different from successor."); PQXX_CHECK(not (j >= i), "Iterator does not precede successor."); PQXX_CHECK(not (j > i), "Iterator follows successor."); PQXX_CHECK(not (i <= j), "operator<=() is asymmetric."); PQXX_CHECK(not (i < j), "operator<() is asymmetric."); PQXX_CHECK(j <= i, "operator<=() is inconsistent."); PQXX_CHECK(j < i, "operator<() is inconsistent."); PQXX_CHECK_EQUAL( 1 + j, i, "Predecessor+1 brings us to wrong place."); result::const_iterator k(i); PQXX_CHECK_EQUAL(k--, i, "Post-decrement returns wrong value."); PQXX_CHECK_EQUAL(k, j, "Post-decrement goes to wrong position."); result::const_iterator l(i); PQXX_CHECK_EQUAL(--l, j, "Pre-decrement returns wrong value."); PQXX_CHECK_EQUAL(l, j, "Pre-decrement goes to wrong position."); PQXX_CHECK_EQUAL(k += 1, i, "operator+=() returns wrong value."); PQXX_CHECK_EQUAL(k, i, "operator+=() goes to wrong position."); PQXX_CHECK_EQUAL(k -= 1, j, "operator-=() returns wrong value."); PQXX_CHECK_EQUAL(k, j, "operator-=() goes to wrong position."); // ...Now let's do meaningful stuff with j, such as finding out which // fields may be sorted. Don't do anything fancy like trying to // detect numbers and comparing them as such, just compare them as // simple strings. for (pqxx::row::size_type f = 0; f < R.columns(); ++f) { if (not j[f].is_null()) { const bool U = SortedUp[f], D = SortedDown[f]; SortedUp[f] = U & ( std::string{j[f].c_str()} <= std::string{i[f].c_str()}); SortedDown[f] = D & ( std::string{j[f].c_str()} >= std::string{i[f].c_str()}); } } } } // Now report on what we've found std::cout << "Read " << to_string(R.size()) << " rows." << std::endl; std::cout << "Field \t Field Name\t Nulls\t Sorted" << std::endl; for (pqxx::row::size_type f = 0; f < R.columns(); ++f) { std::cout << to_string(f) << ":\t" << R.column_name(f) << '\t' << NullFields[f] << '\t' << (SortedUp[f] ? (SortedDown[f] ? "equal" : "up" ) : (SortedDown[f] ? "down" : "no" ) ) << std::endl; PQXX_CHECK_BOUNDS( NullFields[f], 0, int(R.size()) + 1, "Found more nulls than there were rows."); } } PQXX_REGISTER_TEST(test_031); } // namespace libpqxx-6.4.5/test/test32.cxx000066400000000000000000000037321350065432700160560ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Verify abort behaviour of transactor. // // The program will attempt to add an entry to a table called "pqxxevents", // with a key column called "year"--and then abort the change. // // Note for the superstitious: the numbering for this test program is pure // coincidence. namespace { // Let's take a boring year that is not going to be in the "pqxxevents" table const int BoringYear = 1977; std::pair count_events(connection_base &conn, std::string table) { const std::string CountQuery = "SELECT count(*) FROM " + table; row R; int all_years, boring_year; work tx{conn}; R = tx.exec1(CountQuery); R.front().to(all_years); R = tx.exec1(CountQuery + " WHERE year=" + to_string(BoringYear)); R.front().to(boring_year); return std::make_pair(all_years, boring_year); } struct deliberate_error : std::exception { }; void test_032() { lazyconnection conn; { nontransaction tx{conn}; test::create_pqxxevents(tx); } const std::string Table = "pqxxevents"; const std::pair Before = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL( Before.second, 0, "Already have event for " + to_string(BoringYear) + ", cannot test."); { quiet_errorhandler d(conn); PQXX_CHECK_THROWS( perform( [&conn, &Table]() { work{conn}.exec0( "INSERT INTO " + Table + " VALUES (" + to_string(BoringYear) + ", " "'yawn')"); throw deliberate_error(); }), deliberate_error, "Did not get expected exception from failing transactor."); } const std::pair After = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL(After.first, Before.first, "Event count changed."); PQXX_CHECK_EQUAL( After.second, Before.second, "Event count for " + to_string(BoringYear) + " changed."); } PQXX_REGISTER_TEST(test_032); } // namespace libpqxx-6.4.5/test/test33.cxx000066400000000000000000000012621350065432700160530ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Open connection to database, start // a dummy transaction to gain nontransactional access, and perform a query. namespace { void test_033() { lazyconnection conn; nontransaction tx{conn}; result R( tx.exec("SELECT * FROM pg_tables") ); for (const auto &c: R) { std::string N; c[0].to(N); std::cout << '\t' << to_string(c.num()) << '\t' << N << std::endl; } // "Commit" the non-transaction. This doesn't really do anything since // nontransaction doesn't start a backend transaction. tx.commit(); } PQXX_REGISTER_TEST(test_033); } // namespace libpqxx-6.4.5/test/test34.cxx000066400000000000000000000013041350065432700160510ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Open connection to database, start // a dummy transaction to gain nontransactional access, and perform a query. // This test uses a lazy connection. namespace { void test_034() { lazyconnection conn; #include // See if deactivate() behaves... conn.deactivate(); #include const auto r = perform( [&conn](){ return nontransaction{conn}.exec("SELECT generate_series(1, 4)"); }); PQXX_CHECK_EQUAL(r.size(), 4u, "Unexpected transactor result."); } PQXX_REGISTER_TEST(test_034); } // namespace libpqxx-6.4.5/test/test35.cxx000066400000000000000000000011661350065432700160600ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Open connection to database, start // a dummy transaction to gain nontransactional access, and perform a query. // This test combines a lazy connection with a robust transaction. namespace { void test_035() { lazyconnection conn; robusttransaction<> tx{conn}; result R( tx.exec("SELECT * FROM pg_tables") ); for (const auto &c: R) { std::string N; c[0].to(N); std::cout << '\t' << to_string(c.num()) << '\t' << N << std::endl; } tx.commit(); } PQXX_REGISTER_TEST(test_035); } // namespace libpqxx-6.4.5/test/test36.cxx000066400000000000000000000010061350065432700160520ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Open connection to database, start // a dummy transaction to gain nontransactional access, and perform a query. namespace { void test_036() { lazyconnection conn; const auto r = perform( [&conn]() { return nontransaction{conn}.exec("SELECT generate_series(1, 8)"); }); PQXX_CHECK_EQUAL(r.size(), 8u, "Unexpected transactor result."); } PQXX_REGISTER_TEST(test_036); } // namespace libpqxx-6.4.5/test/test37.cxx000066400000000000000000000041361350065432700160620ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Verify abort behaviour of RobustTransaction with // a lazy connection. // // The program will attempt to add an entry to a table called "pqxxevents", // with a key column called "year"--and then abort the change. namespace { // Let's take a boring year that is not going to be in the "pqxxevents" table const int BoringYear = 1977; // Count events and specifically events occurring in Boring Year, leaving the // former count in the result pair's first member, and the latter in second. std::pair count_events(connection_base &conn, std::string table) { const std::string CountQuery = "SELECT count(*) FROM " + table; row R; int all_years, boring_year; nontransaction tx{conn}; R = tx.exec1(CountQuery.c_str()); R.front().to(all_years); R = tx.exec1(CountQuery + " WHERE year=" + to_string(BoringYear)); R.front().to(boring_year); return std::make_pair(all_years, boring_year); } struct deliberate_error : std::exception { }; void test_037() { lazyconnection conn; { nontransaction tx{conn}; test::create_pqxxevents(tx); } const std::string Table = "pqxxevents"; const std::pair Before = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL( Before.second, 0, "Already have event for " + to_string(BoringYear) + ", cannot test."); { quiet_errorhandler d(conn); PQXX_CHECK_THROWS( perform( [&conn, &Table](){ robusttransaction<> tx{conn}; tx.exec0( "INSERT INTO " + Table + " VALUES (" + to_string(BoringYear) + ", " "'yawn')"); throw deliberate_error(); }), deliberate_error, "Did not get expected exception from failing transactor."); } const std::pair After = perform( std::bind(count_events, std::ref(conn), Table)); PQXX_CHECK_EQUAL(After.first, Before.first, "Number of events changed."); PQXX_CHECK_EQUAL( After.second, Before.second, "Number of events for " + to_string(BoringYear) + " changed."); } PQXX_REGISTER_TEST(test_037); } // namespace libpqxx-6.4.5/test/test39.cxx000066400000000000000000000037131350065432700160640ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Test: nontransaction changes are committed immediately (tested here against // a lazyconnection). namespace { int BoringYear = 1977; void test_039() { lazyconnection conn; nontransaction tx1{conn}; test::create_pqxxevents(tx1); const std::string Table = "pqxxevents"; // Verify our start condition before beginning: there must not be a 1977 // record already. result R( tx1.exec("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)) ); PQXX_CHECK_EQUAL( R.size(), 0u, "Already have a row for " + to_string(BoringYear) + ", cannot test."); // (Not needed, but verify that clear() works on empty containers) R.clear(); PQXX_CHECK(R.empty(), "Result is non-empty after clear()."); // OK. Having laid that worry to rest, add a record for 1977. tx1.exec0( "INSERT INTO " + Table + " VALUES" "(" + to_string(BoringYear) + "," "'Yawn'" ")"); // Abort tx1. Since tx1 is a nontransaction, which provides only the // transaction class interface without providing any form of transactional // integrity, this is not going to undo our work. tx1.abort(); // Verify that our record was added, despite the Abort() nontransaction tx2(conn, "tx2"); R = tx2.exec("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)); PQXX_CHECK_EQUAL(R.size(), 1u, "Unexpected result size."); PQXX_CHECK(R.capacity() >= R.size(), "Result's capacity is too small."); R.clear(); PQXX_CHECK(R.empty(), "result::clear() is broken."); // Now remove our record again tx2.exec0("DELETE FROM " + Table + " " "WHERE year=" + to_string(BoringYear)); tx2.commit(); // And again, verify results nontransaction tx3(conn, "tx3"); R = tx3.exec("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)); PQXX_CHECK_EQUAL(R.size(), 0u, "Record is not gone as expected."); } PQXX_REGISTER_TEST(test_039); } // namespace libpqxx-6.4.5/test/test46.cxx000066400000000000000000000036071350065432700160640ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Streams test program for libpqxx. Insert a result field into various // types of streams. namespace { void test_046() { connection conn; work tx{conn}; row R{ tx.exec1("SELECT count(*) FROM pg_tables") }; std::cout << "Count was " << R.front() << std::endl; // Read the value into a stringstream std::stringstream I; I << R[0]; // Now convert the stringstream into a numeric type long L, L2; I >> L; std::cout << "As a long, it's " << L << std::endl; R[0].to(L2); PQXX_CHECK_EQUAL(L, L2, "Inconsistency between conversion methods."); float F, F2; std::stringstream I2; I2 << R[0]; I2 >> F; std::cout << "As a float, it's " << F << std::endl; R[0].to(F2); PQXX_CHECK_BOUNDS(F2, F-0.01, F+0.01, "Bad floating-point result."); float F3; from_string(R[0].c_str(), F3); PQXX_CHECK_BOUNDS(F3, F-0.01, F+0.01, "Bad float from from_string."); double D; from_string(R[0].c_str(), D); PQXX_CHECK_BOUNDS(D, F-0.01, F+0.01, "Bad double from from_string."); long double LD; from_string(R[0].c_str(), LD); PQXX_CHECK_BOUNDS(LD, F-0.01, F+0.01, "Bad long double from from_string."); std::string S, S2, S3; from_string(R[0].c_str(), S); from_string(std::string{R[0].c_str()}, S2); from_string(R[0], S3); PQXX_CHECK_EQUAL( S2, S, "from_string(const char[], std::string &) " "is inconsistent with " "from_string(const std::string &, std::string &)."); PQXX_CHECK_EQUAL( S3, S2, "from_string(const result::field &, std::string &) " "is inconsistent with " "from _string(const std::string &, std::string &)."); PQXX_CHECK( tx.exec1("SELECT 1=1").front().as(), "1=1 doesn't yield 'true.'"); PQXX_CHECK( not tx.exec1("SELECT 2+2=5").front().as(), "2+2=5 yields 'true.'"); } PQXX_REGISTER_TEST(test_046); } // namespace libpqxx-6.4.5/test/test48.cxx000066400000000000000000000032261350065432700160630ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx's Large Objects interface. namespace { /* Read contents of Stream into a single string. The data will go through * input formatting, so whitespace will be taken as separators between chunks * of data. */ template std::string UnStream(T &Stream) { std::string Result, X; while (Stream >> X) Result += X; return Result; } void test_048() { connection conn; largeobject Obj(oid_none); const std::string Contents = "Testing, testing, 1-2-3"; perform( [&conn, &Obj, &Contents]() { work tx{conn}; auto new_obj = largeobject(tx); std::cout << "Created large object #" << new_obj.id() << std::endl; olostream S(tx, new_obj); S << Contents; S.flush(); tx.commit(); Obj = new_obj; }); const std::string Readback = perform( [&conn, &Obj]() { work tx{conn}; ilostream S(tx, Obj.id()); return UnStream(S); }); perform([&conn, &Obj](){ work tx{conn}; Obj.remove(tx); tx.commit(); }); /* Reconstruct what will happen to our contents string if we put it into a * stream and then read it back. We can compare this with what comes back * from our large object stream. */ std::stringstream TestStream; TestStream << Contents; const std::string StreamedContents = UnStream(TestStream); std::cout << StreamedContents << std::endl << Readback << std::endl; PQXX_CHECK_EQUAL( Readback, StreamedContents, "Got wrong number of bytes from large object."); } PQXX_REGISTER_TEST(test_048); } // namespace libpqxx-6.4.5/test/test49.cxx000066400000000000000000000044501350065432700160640ustar00rootroot00000000000000#include #include #include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Run a query and try various standard C++ // algorithms on its result. namespace { // Adds first element of each row it receives to a container template struct Add { CONTAINER &Container; std::string Key; Add(std::string K, CONTAINER &C) : Container(C), Key(K) {} void operator()(const pqxx::row &T) { Container.push_back(T[Key].c_str()); } }; template Add AdderFor(std::string K, CONTAINER &C) { return Add(K, C); } struct Cmp { using first_argument_type = pqxx::row; using second_argument_type = pqxx::row; using result_type = bool; std::string Key; explicit Cmp(std::string K) : Key(K) {} bool operator()(const pqxx::row &L, const pqxx::row &R) const { return std::string{L[Key].c_str()} < std::string{R[Key].c_str()}; } }; struct CountGreaterSmaller { std::string Key; const result &R; CountGreaterSmaller(std::string K, const result &X) : Key(K), R(X) {} void operator()(const pqxx::row &T) const { // Count number of entries with key greater/smaller than first row's key // using std::count_if<>() using namespace std::placeholders; const auto Greater = std::count_if(R.begin(), R.end(), std::bind(Cmp(Key), _1, T)), Smaller = std::count_if(R.begin(), R.end(), std::bind(Cmp(Key), T, _1)); std::cout << "'" << T[Key] << "': " << Greater << " greater, " << Smaller << " smaller " << "(" << (Greater + Smaller) << " total)" << std::endl; PQXX_CHECK( Greater + Smaller < ptrdiff_t(R.size()), "More non-equal rows than rows."); } }; void test_049() { connection conn; work tx{conn}; std::string Table="pg_tables", Key="tablename"; result R( tx.exec("SELECT * FROM " + Table + " ORDER BY " + Key) ); std::cout << "Read " << R.size() << " rows." << std::endl; PQXX_CHECK(not R.empty(), "No rows in " + Table + "."); // Verify that for each key in R, the number of greater and smaller keys // are sensible; use std::for_each<>() to iterate over rows in R std::for_each(R.begin(), R.end(), CountGreaterSmaller(Key, R)); } PQXX_REGISTER_TEST(test_049); } // namespace libpqxx-6.4.5/test/test50.cxx000066400000000000000000000044631350065432700160600ustar00rootroot00000000000000#include #include #include #include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx's Large Objects interface. namespace { const std::string Contents = "Large object test contents"; void test_050() { connection conn; // Create a large object. largeobject Obj = perform( [&conn]() { work tx{conn}; const auto obj = largeobject(tx); tx.commit(); return obj; }); // Write to the large object, and play with it a little. perform( [&conn, &Obj]() { work tx{conn}; largeobjectaccess A(tx, Obj); const auto orgpos = A.ctell(), copyorgpos = A.ctell(); PQXX_CHECK_EQUAL(orgpos, 0, "Bad initial position in large object."); PQXX_CHECK_EQUAL(copyorgpos, orgpos, "ctell() affected positioning."); const largeobjectaccess::pos_type cxxorgpos = A.tell(); PQXX_CHECK_EQUAL(cxxorgpos, orgpos, "tell() reports bad position."); A.process_notice("Writing to large object #" + to_string(largeobject(A).id()) + "\n"); long Bytes = A.cwrite( Contents.c_str(), largeobject::size_type(Contents.size())); PQXX_CHECK_EQUAL( Bytes, long(Contents.size()), "Wrote wrong number of bytes."); PQXX_CHECK_EQUAL( A.tell(), A.ctell(), "tell() is inconsistent with ctell()."); PQXX_CHECK_EQUAL(A.tell(), Bytes, "Bad large-object position."); char Buf[200]; const size_t Size = sizeof(Buf) - 1; PQXX_CHECK_EQUAL( A.cread(Buf, Size), 0, "Bad return value from cread() after writing."); PQXX_CHECK_EQUAL( size_t(A.cseek(0, std::ios::cur)), Contents.size(), "Unexpected position after cseek(0, cur)."); PQXX_CHECK_EQUAL( A.cseek(1, std::ios::beg), 1, "Unexpected cseek() result after seeking to position 1."); PQXX_CHECK_EQUAL( A.cseek(-1, std::ios::cur), 0, "Unexpected cseek() result after seeking -1 from position 1."); PQXX_CHECK(size_t(A.read(Buf, Size)) <= Size, "Got too many bytes."); PQXX_CHECK_EQUAL( std::string(Buf, std::string::size_type(Bytes)), Contents, "Large-object contents were mutilated."); tx.commit(); }); perform( [&conn, &Obj]() { work tx{conn}; Obj.remove(tx); tx.commit(); }); } PQXX_REGISTER_TEST(test_050); } // namespace libpqxx-6.4.5/test/test51.cxx000066400000000000000000000043451350065432700160600ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx's Large Objects interface. namespace { const std::string Contents = "Large object test contents"; void test_051() { connection conn; largeobject obj = perform( [&conn]() { work tx{conn}; largeobjectaccess A(tx); auto new_obj = largeobject(A); A.write(Contents); char Buf[200]; const auto Size = sizeof(Buf) - 1; auto Offset = A.seek(0, std::ios::beg); PQXX_CHECK_EQUAL(Offset, 0, "Wrong position after seek to beginning."); PQXX_CHECK_EQUAL( size_t(A.read(Buf, Size)), Contents.size(), "Unexpected read() result."); PQXX_CHECK_EQUAL( std::string(Buf, Contents.size()), Contents, "Large object contents were mutilated."); // Now write contents again, this time as a conn string PQXX_CHECK_EQUAL( A.seek(-int(Contents.size()), std::ios::end), 0, "Bad position after seeking to beginning of large object."); using lobj_size_t = largeobjectaccess::size_type; A.write(Buf, lobj_size_t(Contents.size())); A.seek(0, std::ios::beg); PQXX_CHECK_EQUAL( size_t(A.read(Buf, Size)), Contents.size(), "Bad length for rewritten large object."); PQXX_CHECK_EQUAL( std::string(Buf, Contents.size()), Contents, "Rewritten large object was mangled."); tx.commit(); return new_obj; }); PQXX_CHECK( obj != largeobject{}, "Large objects: false negative on operator!=()."); PQXX_CHECK( not (obj == largeobject{}), "Large objects: false positive on operator==()."); PQXX_CHECK( not (obj != obj), "Large objects: false positive on operator!=()."); PQXX_CHECK( obj == obj, "Large objects: false negative on operator==()."); PQXX_CHECK( obj <= obj, "Large objects: false negative on operator<=()."); PQXX_CHECK( obj >= obj, "Large objects: false negative on operator>=()."); PQXX_CHECK( not (obj < obj), "Large objects: false positive on operator<()."); PQXX_CHECK( not (obj > obj), "Large objects: false positive on operator>()."); perform( [&conn, &obj]() { work tx{conn}; obj.remove(tx); tx.commit(); }); } PQXX_REGISTER_TEST(test_051); } // namespace libpqxx-6.4.5/test/test52.cxx000066400000000000000000000015361350065432700160600ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx: write large object to test files. namespace { const std::string Contents = "Large object test contents"; void test_052() { connection conn; largeobject Obj = perform( [&conn]() { work tx{conn}; auto obj = largeobject{tx}; tx.commit(); return obj; }); perform( [&conn, &Obj]() { work tx{conn}; largeobjectaccess A{tx, Obj.id(), std::ios::out}; A.write(Contents); tx.commit(); }); perform( [&conn, &Obj]() { work tx{conn}; Obj.to_file(tx, "pqxxlo.txt"); tx.commit(); }); perform( [&conn, &Obj]() { work tx{conn}; Obj.remove(tx); tx.commit(); }); } PQXX_REGISTER_TEST(test_052); } // namespace libpqxx-6.4.5/test/test53.cxx000066400000000000000000000015611350065432700160570ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx: import file to large object namespace { const std::string Contents = "Large object test contents"; void test_053() { connection conn; largeobject Obj = perform( [&conn]() { work tx{conn}; auto obj = largeobject{tx, "pqxxlo.txt"}; tx.commit(); return obj; }); perform( [&conn, &Obj]() { char Buf[200]; work tx{conn}; largeobjectaccess O{tx, Obj, std::ios::in}; const auto len = O.read(Buf, sizeof(Buf)-1); PQXX_CHECK_EQUAL( std::string(Buf, std::string::size_type(len)), Contents, "Large object contents were mangled."); tx.commit(); }); perform([&conn, &Obj](){ work tx{conn}; Obj.remove(tx); tx.commit(); }); } PQXX_REGISTER_TEST(test_053); } // namespace libpqxx-6.4.5/test/test54.cxx000066400000000000000000000012331350065432700160540ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx: write large object to test files. namespace { const std::string Contents = "Large object test contents"; void test_054() { connection conn; largeobject Obj = perform( [&conn]() { work tx{conn}; largeobjectaccess A(tx); auto new_obj = largeobject(A); A.write(Contents); A.to_file("pqxxlo.txt"); tx.commit(); return new_obj; }); perform( [&conn, &Obj]() { work tx{conn}; Obj.remove(tx); tx.commit(); }); } PQXX_REGISTER_TEST(test_054); } // namespace libpqxx-6.4.5/test/test55.cxx000066400000000000000000000014761350065432700160660ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx: import file to large object namespace { const std::string Contents = "Large object test contents"; void test_055() { connection conn; largeobject Obj = perform( [&conn]() { char Buf[200]; work tx{conn}; largeobjectaccess A{tx, "pqxxlo.txt", std::ios::in}; auto new_obj = largeobject(A); const auto len = A.read(Buf, sizeof(Buf)-1); PQXX_CHECK_EQUAL( std::string(Buf, std::string::size_type(len)), Contents, "Large object contents were mangled."); tx.commit(); return new_obj; }); perform( [&conn, &Obj]() { work tx{conn}; Obj.remove(tx); tx.commit(); }); } PQXX_REGISTER_TEST(test_055); } // namespace libpqxx-6.4.5/test/test56.cxx000066400000000000000000000006541350065432700160640ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Issue invalid query and handle error. namespace { void test_056() { connection conn; work tx{conn}; quiet_errorhandler d(conn); PQXX_CHECK_THROWS( tx.exec("DELIBERATELY INVALID TEST QUERY...", "invalid_query"), sql_error, "SQL syntax error did not raise expected exception."); } PQXX_REGISTER_TEST(test_056); } // namespace libpqxx-6.4.5/test/test57.cxx000066400000000000000000000030461350065432700160630ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx's Large Objects interface. namespace { /* Read contents of Stream into a single string. The data will go through * input formatting, so whitespace will be taken as separators between chunks * of data. */ template std::string UnStream(T &Stream) { std::string Result, X; while (Stream >> X) Result += X; return Result; } void test_057() { connection conn; const std::string Contents = "Testing, testing, 1-2-3"; largeobject Obj = perform( [&conn, &Contents]() { work tx{conn}; auto new_obj = largeobject{tx}; olostream S(tx, new_obj.id()); S << Contents; S.flush(); tx.commit(); return new_obj; }); const std::string Readback = perform( [&conn, &Obj]() { work tx{conn}; ilostream S(tx, Obj); return UnStream(S); }); perform( [&conn, &Obj]() { work tx{conn}; Obj.remove(tx); tx.commit(); }); /* Reconstruct what will happen to our contents string if we put it into a * stream and then read it back. We can compare this with what comes back * from our large object stream. */ std::stringstream TestStream; TestStream << Contents; const std::string StreamedContents = UnStream(TestStream); std::cout << StreamedContents << std::endl << Readback << std::endl; PQXX_CHECK_EQUAL(Readback, StreamedContents, "Contents were mangled."); } PQXX_REGISTER_TEST(test_057); } // namespace libpqxx-6.4.5/test/test58.cxx000066400000000000000000000031471350065432700160660ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; namespace { const std::string Contents = "Large object test contents"; // Mixed-mode, seeking test program for libpqxx's Large Objects interface. void test_058() { connection conn; perform( [&conn]() { work tx{conn}; largeobjectaccess A(tx); A.write(Contents); char Buf[200]; const size_t Size = sizeof(Buf) - 1; PQXX_CHECK_EQUAL( A.read(Buf, Size), 0, "Could read bytes from large object after writing."); // Overwrite terminating zero. auto Here = A.seek(-1, std::ios::cur); PQXX_CHECK_EQUAL( Here, largeobject::size_type(Contents.size()-1), "Ended up in wrong place after moving back 1 byte."); A.write("!", 1); // Now check that we really did. PQXX_CHECK_EQUAL( A.seek(-1, std::ios::cur), largeobject::size_type(Contents.size()-1), "Inconsistent seek."); char Check; PQXX_CHECK_EQUAL( A.read(&Check, 1), 1, "Unexpected result from read()."); PQXX_CHECK_EQUAL( std::string(&Check, 1), "!", "Read back wrong character."); PQXX_CHECK_EQUAL( A.seek(0, std::ios::beg), 0, "Ended up in wrong place after seeking back to beginning."); PQXX_CHECK_EQUAL( A.read(&Check, 1), 1, "Unexpected result when trying to read back 1st byte."); PQXX_CHECK_EQUAL( std::string(&Check, 1), std::string(Contents, 0, 1), "Wrong first character in large object."); // Clean up after ourselves A.remove(tx); tx.commit(); }); } PQXX_REGISTER_TEST(test_058); } // namespace libpqxx-6.4.5/test/test59.cxx000066400000000000000000000030521350065432700160620ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx's Large Objects interface. namespace { /* Read contents of Stream into a single string. The data will go through * input formatting, so whitespace will be taken as separators between chunks * of data. */ template std::string UnStream(T &Stream) { std::string Result, X; while (Stream >> X) Result += X; return Result; } void test_059() { connection conn; const std::string Contents = "Testing, testing, 1-2-3"; largeobject Obj = perform( [&conn, &Contents]() { work tx{conn}; auto new_obj = largeobject(tx); lostream S(tx, new_obj.id()); S << Contents; S.flush(); tx.commit(); return new_obj; }); const std::string Readback = perform( [&conn, &Obj]() { work tx{conn}; lostream S(tx, Obj, std::ios::in); return UnStream(S); }); perform([&conn, &Obj](){ work tx{conn}; Obj.remove(tx); tx.commit(); }); /* Reconstruct what will happen to our contents string if we put it into a * stream and then read it back. We can compare this with what comes back * from our large object stream. */ std::stringstream TestStream; TestStream << Contents; const std::string StreamedContents = UnStream(TestStream); std::cout << StreamedContents << std::endl << Readback << std::endl; PQXX_CHECK_EQUAL( Readback, StreamedContents, "Large object contents were mangled."); } PQXX_REGISTER_TEST(test_059); } // namespace libpqxx-6.4.5/test/test60.cxx000066400000000000000000000043031350065432700160520ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Test session variable functionality. namespace { std::string GetDatestyle(connection_base &conn) { return nontransaction(conn, "getdatestyle").get_variable("DATESTYLE"); } std::string SetDatestyle(connection_base &conn, std::string style) { conn.set_variable("DATESTYLE", style); const std::string fullname = GetDatestyle(conn); std::cout << "Set datestyle to " << style << ": " << fullname << std::endl; PQXX_CHECK( not fullname.empty(), "Setting datestyle to " + style + " makes it an empty string."); return fullname; } void CheckDatestyle(connection_base &conn, std::string expected) { PQXX_CHECK_EQUAL(GetDatestyle(conn), expected, "Got wrong datestyle."); } void RedoDatestyle( connection_base &conn, std::string style, std::string expected) { PQXX_CHECK_EQUAL(SetDatestyle(conn, style), expected, "Set wrong datestyle."); } void ActivationTest( connection_base &conn, std::string style, std::string expected) { RedoDatestyle(conn, style, expected); std::cout << "Deactivating connection..." << std::endl; #include conn.deactivate(); #include CheckDatestyle(conn, expected); std::cout << "Reactivating connection..." << std::endl; #include conn.activate(); #include CheckDatestyle(conn, expected); } void test_060() { connection conn; PQXX_CHECK(not GetDatestyle(conn).empty(), "Initial datestyle not set."); const std::string ISOname = SetDatestyle(conn, "ISO"); const std::string SQLname = SetDatestyle(conn, "SQL"); PQXX_CHECK_NOT_EQUAL(ISOname, SQLname, "Same datestyle in SQL and ISO."); RedoDatestyle(conn, "SQL", SQLname); ActivationTest(conn, "ISO", ISOname); ActivationTest(conn, "SQL", SQLname); // Prove that setting an unknown variable causes an error, as expected quiet_errorhandler d{conn}; PQXX_CHECK_THROWS( conn.set_variable("NONEXISTENT_VARIABLE_I_HOPE", "1"), sql_error, "Setting unknown variable failed to fail."); } PQXX_REGISTER_TEST(test_060); } // namespace libpqxx-6.4.5/test/test61.cxx000066400000000000000000000026061350065432700160570ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Test local variable functionality. namespace { std::string GetDatestyle(transaction_base &T) { return T.get_variable("DATESTYLE"); } std::string SetDatestyle(transaction_base &T, std::string style) { T.set_variable("DATESTYLE", style); const std::string fullname = GetDatestyle(T); std::cout << "Set datestyle to " << style << ": " << fullname << std::endl; PQXX_CHECK( not fullname.empty(), "Setting datestyle to " + style + " makes it an empty string."); return fullname; } void RedoDatestyle(transaction_base &T, std::string style, std::string expected) { PQXX_CHECK_EQUAL(SetDatestyle(T, style), expected, "Set wrong datestyle."); } void test_061() { connection conn; work tx{conn}; PQXX_CHECK(not GetDatestyle(tx).empty(), "Initial datestyle not set."); const std::string ISOname = SetDatestyle(tx, "ISO"); const std::string SQLname = SetDatestyle(tx, "SQL"); PQXX_CHECK_NOT_EQUAL(ISOname, SQLname, "Same datestyle in SQL and ISO."); RedoDatestyle(tx, "SQL", SQLname); // Prove that setting an unknown variable causes an error, as expected quiet_errorhandler d(tx.conn()); PQXX_CHECK_THROWS( tx.set_variable("NONEXISTENT_VARIABLE_I_HOPE", "1"), sql_error, "Setting unknown variable failed to fail."); } PQXX_REGISTER_TEST(test_061); } // namespace libpqxx-6.4.5/test/test62.cxx000066400000000000000000000055761350065432700160710ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Test binarystring functionality. namespace { void test_062() { connection conn; work tx{conn}; const std::string TestStr = "Nasty\n\030Test\n\t String with \200\277 weird bytes " "\r\0 and Trailer\\\\\0"; tx.exec0("CREATE TEMP TABLE pqxxbin (binfield bytea)"); const std::string Esc = tx.esc_raw(TestStr), Chk = tx.esc_raw( reinterpret_cast(TestStr.c_str()), strlen(TestStr.c_str())); PQXX_CHECK_EQUAL(Chk, Esc, "Inconsistent results from esc_raw()."); tx.exec0("INSERT INTO pqxxbin VALUES ('" + Esc + "')"); result R = tx.exec("SELECT * from pqxxbin"); tx.exec0("DELETE FROM pqxxbin"); binarystring B( R.at(0).at(0) ); PQXX_CHECK(not B.empty(), "Binary string became empty in conversion."); PQXX_CHECK_EQUAL(B.size(), TestStr.size(), "Binary string was mangled."); binarystring::const_iterator c; binarystring::size_type i; for (i=0, c=B.begin(); i0; --i, ++r) { PQXX_CHECK( r != B.rend(), "Premature rend to binary string at " + to_string(i) + "."); using uchar = unsigned char; PQXX_CHECK_EQUAL( int(B[i-1]), int(uchar(TestStr.at(i-1))), "Reverse iterator is broken."); } PQXX_CHECK(r == B.rend(), "rend() of binary string not reached."); PQXX_CHECK_EQUAL(B.str(), TestStr, "Binary string was mangled."); const std::string TestStr2("(More conventional text)"); tx.exec0("INSERT INTO pqxxbin VALUES ('" + TestStr2 + "')"); R = tx.exec("SELECT * FROM pqxxbin"); binarystring B2(R.front().front()); PQXX_CHECK(not (B2 == B), "False positive on binarystring::operator==()."); PQXX_CHECK(B2 != B, "False negative on binarystring::operator!=()."); binarystring B1c(B), B2c(B2); PQXX_CHECK(not (B1c != B), "Copied binarystring differs from original."); PQXX_CHECK(B2c == B2, "Copied binarystring not equal to original."); B1c.swap(B2c); PQXX_CHECK(B2c != B1c, "binarystring::swap() produced identical strings."); PQXX_CHECK(B2c == B, "binarystring::swap() is broken."); PQXX_CHECK(B1c == B2, "Cross-check of swapped binarystrings failed."); } PQXX_REGISTER_TEST(test_062); } // namespace libpqxx-6.4.5/test/test63.cxx000066400000000000000000000011361350065432700160560ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx's asyncconnection. Asynchronously open a // connection to the database, start a transaction, and perform a query inside // it. namespace { void test_063() { asyncconnection conn; work tx{conn}; result R( tx.exec("SELECT * FROM pg_tables") ); PQXX_CHECK(not R.empty(), "No tables found. Cannot test."); for (const auto &c: R) std::cout << '\t' << to_string(c.num()) << '\t' << c[0].as(std::string{}) << std::endl; tx.commit(); } PQXX_REGISTER_TEST(test_063); } // namespace libpqxx-6.4.5/test/test64.cxx000066400000000000000000000037751350065432700160720ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Test session variables with asyncconnection. namespace { std::string GetDatestyle(connection_base &conn) { return nontransaction(conn, "getdatestyle").get_variable("DATESTYLE"); } std::string SetDatestyle(connection_base &conn, std::string style) { conn.set_variable("DATESTYLE", style); const std::string fullname = GetDatestyle(conn); PQXX_CHECK( not fullname.empty(), "Setting datestyle to " + style + " makes it an empty string."); return fullname; } void CheckDatestyle(connection_base &conn, std::string expected) { PQXX_CHECK_EQUAL(GetDatestyle(conn), expected, "Got wrong datestyle."); } void RedoDatestyle( connection_base &conn, std::string style, std::string expected) { PQXX_CHECK_EQUAL(SetDatestyle(conn, style), expected, "Set wrong datestyle."); } void ActivationTest( connection_base &conn, std::string style, std::string expected) { RedoDatestyle(conn, style, expected); #include conn.deactivate(); #include CheckDatestyle(conn, expected); #include conn.activate(); #include CheckDatestyle(conn, expected); } void test_064() { asyncconnection conn; PQXX_CHECK(not GetDatestyle(conn).empty(), "Initial datestyle not set."); const std::string ISOname = SetDatestyle(conn, "ISO"); const std::string SQLname = SetDatestyle(conn, "SQL"); PQXX_CHECK_NOT_EQUAL(ISOname, SQLname, "Same datestyle in SQL and ISO."); RedoDatestyle(conn, "SQL", SQLname); ActivationTest(conn, "ISO", ISOname); ActivationTest(conn, "SQL", SQLname); // Prove that setting an unknown variable causes an error, as expected quiet_errorhandler d(conn); PQXX_CHECK_THROWS( conn.set_variable("NONEXISTENT_VARIABLE_I_HOPE", "1"), sql_error, "Setting unknown variable failed to fail."); } PQXX_REGISTER_TEST(test_064); } // namespace libpqxx-6.4.5/test/test65.cxx000066400000000000000000000031071350065432700160600ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx's large objects on asynchronous connection. namespace { /* Read contents of Stream into a single string. The data will go through * input formatting, so whitespace will be taken as separators between chunks * of data. */ template std::string UnStream(T &Stream) { std::string Result, X; while (Stream >> X) Result += X; return Result; } void test_065() { asyncconnection conn(""); const std::string Contents = "Testing, testing, 1-2-3"; largeobject Obj = perform( [&conn, &Contents]() { work tx{conn}; auto new_obj = largeobject{tx}; lostream S{tx, new_obj.id()}; S << Contents; S.flush(); tx.commit(); return new_obj; }); const std::string Readback = perform( [&conn, &Obj] { work tx{conn}; lostream S{tx, Obj, std::ios::in}; return UnStream(S); }); perform([&conn, &Obj](){ work tx{conn}; Obj.remove(tx); tx.commit(); }); /* Reconstruct what will happen to our contents string if we put it into a * stream and then read it back. We can compare this with what comes back * from our large object stream. */ std::stringstream TestStream; TestStream << Contents; const std::string StreamedContents = UnStream(TestStream); std::cout << StreamedContents << std::endl << Readback << std::endl; PQXX_CHECK_EQUAL(Readback, StreamedContents, "Large object was mangled."); } PQXX_REGISTER_TEST(test_065); } // namespace libpqxx-6.4.5/test/test66.cxx000066400000000000000000000040001350065432700160520ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Test: nontransaction changes are committed immediately (tested here against // an asyncconnection). namespace { int BoringYear = 1977; void test_066() { asyncconnection conn; nontransaction tx1{conn}; test::create_pqxxevents(tx1); const std::string Table = "pqxxevents"; // Verify our start condition before beginning: there must not be a 1977 // record already. result R( tx1.exec("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)) ); PQXX_CHECK_EQUAL( R.size(), 0u, "Already have a row for " + to_string(BoringYear) + ", cannot test."); // (Not needed, but verify that clear() works on empty containers) R.clear(); PQXX_CHECK(R.empty(), "Result is not empty after clear()."); // OK. Having laid that worry to rest, add a record for 1977. tx1.exec0( "INSERT INTO " + Table + " VALUES" "(" + to_string(BoringYear) + "," "'Yawn'" ")"); // Abort T1. Since T1 is a nontransaction, which provides only the // transaction class interface without providing any form of transactional // integrity, this is not going to undo our work. tx1.abort(); // Verify that our record was added, despite the Abort() nontransaction tx2(conn, "tx2"); R = tx2.exec("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)); PQXX_CHECK_EQUAL( R.size(), 1u, "Wrong number of records for " + to_string(BoringYear) + "."); PQXX_CHECK(R.capacity() >= R.size(), "Result's capacity is too small."); R.clear(); PQXX_CHECK(R.empty(), "result::clear() doesn't always work."); // Now remove our record again tx2.exec0( "DELETE FROM " + Table + " " "WHERE year=" + to_string(BoringYear)); tx2.commit(); // And again, verify results nontransaction tx3(conn, "tx3"); R = tx3.exec("SELECT * FROM " + Table + " " "WHERE year=" + to_string(BoringYear)); PQXX_CHECK_EQUAL( R.size(), 0u, "Deleted row still seems to be there."); } PQXX_REGISTER_TEST(test_066); } // namespace libpqxx-6.4.5/test/test67.cxx000066400000000000000000000065221350065432700160660ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. See which fields in a query are null, and figure // out whether any fields are lexicographically sorted. Use asyncconnection. namespace { template void InitVector(VEC &V, typename VEC::size_type s, VAL val) { V.resize(s); for (auto i = V.begin(); i != V.end(); ++i) *i = val; } void test_067() { asyncconnection conn; const std::string Table = "pg_tables"; #include // Tell conn we won't be needing it for a while (not true, but let's pretend). conn.deactivate(); #include // Now set up some data structures std::vector NullFields; // Maps column to no. of null fields std::vector SortedUp, SortedDown; // Does column appear to be sorted? #include // ...And reactivate conn (not really needed, but it sounds more polite). conn.activate(); #include work tx{conn, "test67"}; result R{ tx.exec("SELECT * FROM " + Table) }; InitVector(NullFields, R.columns(), 0); InitVector(SortedUp, R.columns(), true); InitVector(SortedDown, R.columns(), true); for (auto i = R.begin(); i != R.end(); i++) { PQXX_CHECK_EQUAL( (*i).rownumber(), i->rownumber(), "operator*() is inconsistent with operator->()."); PQXX_CHECK_EQUAL(i->size(), R.columns(), "result::columns() is broken."); // Look for null fields for (pqxx::row::size_type f=0; fsize(); ++f) { NullFields[f] += i.at(f).is_null(); std::string A, B; PQXX_CHECK_EQUAL( i[f].to(A), i[f].to(B, std::string{""}), "Variants of to() disagree on nullness."); PQXX_CHECK_EQUAL(A, B, "to() variants return different values."); } // Compare fields to those of preceding row if (i != R.begin()) { const auto j = i - 1; // First perform some sanity checks on j vs. i and how libpqxx handles // their interrelationship... PQXX_CHECK_EQUAL(i - j, 1, "Successor is at wrong distance."); // ...Now let's do meaningful stuff with j, such as finding out which // fields may be sorted. Don't do anything fancy like trying to // detect numbers and comparing them as such, just compare them as // simple strings. for (pqxx::row::size_type f = 0; f < R.columns(); ++f) { if (not j[f].is_null() and not i[f].is_null()) { const bool U = SortedUp[f], D = SortedDown[f]; SortedUp[f] = ( U and (j[f].as() <= i[f].as())); SortedDown[f] = ( D and (j[f].as() >= i[f].as())); } } } } // Now report on what we've found std::cout << "Read " << to_string(R.size()) << " rows." << std::endl; std::cout << "Field \t Field Name\t Nulls\t Sorted" << std::endl; for (pqxx::row::size_type f = 0; f < R.columns(); ++f) { std::cout << to_string(f) << ":\t" << R.column_name(f) << '\t' << NullFields[f] << '\t' << (SortedUp[f] ? (SortedDown[f] ? "equal" : "up" ) : (SortedDown[f] ? "down" : "no" ) ) << std::endl; PQXX_CHECK_BOUNDS( NullFields[f], 0, int(R.size()+1), "Found impossible number of nulls."); } } PQXX_REGISTER_TEST(test_067); } // namespace libpqxx-6.4.5/test/test69.cxx000066400000000000000000000021611350065432700160630ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Issue a query repeatedly through a pipeline, and // compare results. namespace { void TestPipeline(pipeline &P, int numqueries) { const std::string Q("SELECT 99"); for (int i=numqueries; i; --i) P.insert(Q); PQXX_CHECK( (numqueries == 0) or not P.empty(), "pipeline::empty() is broken."); int res = 0; for (int i=numqueries; i; --i) { PQXX_CHECK(not P.empty(), "Got wrong number of queries from pipeline."); std::pair R = P.retrieve(); std::cout << "Query #" << R.first << ": " << R.second.at(0).at(0) << std::endl; if (res) PQXX_CHECK_EQUAL( R.second[0][0].as(), res, "Got unexpected result out of pipeline."); res = R.second[0][0].as(); } PQXX_CHECK(P.empty(), "Pipeline not empty after retrieval."); } void test_069() { asyncconnection conn; work tx{conn}; pipeline P(tx); PQXX_CHECK(P.empty(), "Pipeline is not empty initially."); for (int i=0; i<5; ++i) TestPipeline(P, i); } PQXX_REGISTER_TEST(test_069); } // namespace libpqxx-6.4.5/test/test70.cxx000066400000000000000000000051711350065432700160570ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; namespace { void TestPipeline(pipeline &P, int numqueries) { const std::string Q("SELECT * FROM generate_series(1, 10)"); const result Empty; PQXX_CHECK(Empty.empty(), "Default-constructed result is not empty."); PQXX_CHECK(Empty.query().empty(), "Default-constructed result has query"); P.retain(); for (int i=numqueries; i; --i) P.insert(Q); P.resume(); PQXX_CHECK( (numqueries == 0) || not P.empty(), "pipeline::empty() is broken."); int res = 0; result Prev; PQXX_CHECK_EQUAL(Prev, Empty, "Default-constructed results are not equal."); for (int i=numqueries; i; --i) { PQXX_CHECK(not P.empty(), "Got no results from pipeline."); auto R = P.retrieve(); PQXX_CHECK_NOT_EQUAL(R.second, Empty, "Got empty result."); if (Prev != Empty) PQXX_CHECK_EQUAL(R.second, Prev, "Results to same query are different."); Prev = R.second; PQXX_CHECK_EQUAL(Prev, R.second, "Assignment breaks result equality."); PQXX_CHECK_EQUAL(R.second.query(), Q, "Result is for unexpected query."); if (res) PQXX_CHECK_EQUAL(Prev[0][0].as(), res, "Bad result from pipeline."); res = Prev[0][0].as(); } PQXX_CHECK(P.empty(), "Pipeline was not empty after retrieval."); } // Test program for libpqxx. Issue a query repeatedly through a pipeline, and // compare results. Use retain() and resume() for performance. void test_070() { asyncconnection conn; work tx{conn}; pipeline P(tx); PQXX_CHECK(P.empty(), "Pipeline is not empty initially."); // Try to confuse the pipeline by feeding it a query and flushing P.retain(); const std::string Q = "SELECT * FROM pg_tables"; P.insert(Q); P.flush(); PQXX_CHECK(P.empty(), "Pipeline was not empty after flush()."); // See if complete() breaks retain() as it should P.retain(); P.insert(Q); PQXX_CHECK(not P.empty(), "Pipeline was empty after insert()."); P.complete(); PQXX_CHECK(not P.empty(), "complete() emptied pipeline."); PQXX_CHECK_EQUAL( P.retrieve().second.query(), Q, "Result is for wrong query."); PQXX_CHECK(P.empty(), "Pipeline not empty after retrieve()."); // See if retrieve() breaks retain() when it needs to P.retain(); P.insert(Q); PQXX_CHECK_EQUAL( P.retrieve().second.query(), Q, "Got result for wrong query."); // See if regular retain()/resume() works for (int i=0; i<5; ++i) TestPipeline(P, i); // See if retrieve() fails on an empty pipeline, as it should quiet_errorhandler d(conn); PQXX_CHECK_THROWS_EXCEPTION( P.retrieve(), "Empty pipeline allows retrieve()."); } } // namespace PQXX_REGISTER_TEST(test_070); libpqxx-6.4.5/test/test71.cxx000066400000000000000000000033021350065432700160520ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Issue queries through a pipeline, and retrieve // results both in-order and out-of-order. namespace { using Exp = std::map; template void checkresult(pipeline &P, PAIR c) { const result r = P.retrieve(c.first); const int val = r.at(0).at(0).as(int(0)); PQXX_CHECK_EQUAL(val, c.second, "Wrong result from pipeline."); } void test_071() { asyncconnection conn; work tx{conn}; pipeline P(tx); // Keep expected result for every query we issue Exp values; // Insert queries returning various numbers for (int i=1; i<10; ++i) values[P.insert("SELECT " + to_string(i))] = i; // Retrieve results in query_id order, and compare to expected values for (auto &c: values) checkresult(P, c); PQXX_CHECK(P.empty(), "Pipeline was not empty retrieving all results."); values.clear(); // Insert more queries returning various numbers P.retain(20); for (int i=100; i>90; --i) values[P.insert("SELECT " + to_string(i))] = i; P.resume(); // Retrieve results in reverse order for (auto c=values.rbegin(); c!=values.rend(); ++c) checkresult(P, *c); values.clear(); P.retain(10); for (int i=1010; i>1000; --i) values[P.insert("SELECT "+to_string(i))] = i; for (auto &c: values) { if (P.is_finished(c.first)) std::cout << "Query #" << c.first << " completed despite retain()" << std::endl; } // See that all results are retrieved by complete() P.complete(); for (auto &c: values) PQXX_CHECK(P.is_finished(c.first), "Query not finished after complete()."); } } // namespace PQXX_REGISTER_TEST(test_071); libpqxx-6.4.5/test/test72.cxx000066400000000000000000000030361350065432700160570ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Test error handling for pipeline. namespace { void test_072() { asyncconnection conn; work tx{conn}; pipeline P{tx}; // Ensure all queries are issued at once to make the test more interesting P.retain(); // The middle query should fail; the surrounding two should succeed const auto id_1 = P.insert("SELECT 1"); const auto id_f = P.insert("SELECT * FROM pg_nonexist"); const auto id_2 = P.insert("SELECT 2"); // See that we can process the queries without stumbling over the error P.complete(); // We should be able to get the first result, which preceeds the error std::cout << "Retrieving initial result..." << std::endl; const int res_1 = P.retrieve(id_1).at(0).at(0).as(); std::cout << " - result was " << res_1 << std::endl; PQXX_CHECK_EQUAL(res_1, 1, "Got wrong result from pipeline."); // We should *not* get a result for the query behind the error std::cout << "Retrieving post-error result..." << std::endl; { quiet_errorhandler d{conn}; PQXX_CHECK_THROWS( P.retrieve(id_2).at(0).at(0).as(), std::runtime_error, "Pipeline wrongly resumed after SQL error."); } // Now see that we get an exception when we touch the failed result std::cout << "Retrieving result for failed query..." << std::endl; { quiet_errorhandler d{conn}; PQXX_CHECK_THROWS( P.retrieve(id_f), sql_error, "Pipeline failed to register SQL error."); } } } // namespace PQXX_REGISTER_TEST(test_072); libpqxx-6.4.5/test/test73.cxx000066400000000000000000000033711350065432700160620ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Test pipeline's handling of SQL syntax errors on a // more exotic connection type. Using nontransaction so the pipeline gets to // trigger the setup of the real connection. namespace { void test_073() { asyncconnection conn; nontransaction tx{conn}; pipeline P{tx, "pipe73"}; // Ensure all queries are issued at once to make the test more interesting P.retain(); std::cout << "Opened " << P.classname() << " " << P.name() << ": " << P.description() << std::endl; // The middle query should fail; the surrounding two should succeed const auto id_1 = P.insert("SELECT 1"); const auto id_f = P.insert("DELIBERATE SYNTAX ERROR"); const auto id_2 = P.insert("SELECT 2"); // See that we can process the queries without stumbling over the error P.complete(); // We should be able to get the first result, which preceeds the error std::cout << "Retrieving initial result..." << std::endl; const int res_1 = P.retrieve(id_1).at(0).at(0).as(); std::cout << " - result was " << res_1 << std::endl; PQXX_CHECK_EQUAL(res_1, 1, "Got bad result from pipeline."); // We should *not* get a result for the query behind the error std::cout << "Retrieving post-error result..." << std::endl; quiet_errorhandler d{conn}; PQXX_CHECK_THROWS( P.retrieve(id_2).at(0).at(0).as(), std::runtime_error, "Pipeline wrongly resumed after SQL error."); // Now see that we get an exception when we touch the failed result std::cout << "Retrieving result for failed query..." << std::endl; PQXX_CHECK_THROWS( P.retrieve(id_f), sql_error, "Pipeline failed to register SQL error."); } } // namespace PQXX_REGISTER_TEST(test_073); libpqxx-6.4.5/test/test74.cxx000066400000000000000000000034661350065432700160700ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Test fieldstream. namespace { void test_074() { connection conn; work tx{conn}; result R = tx.exec("SELECT * FROM pg_tables"); const std::string sval = R.at(0).at(1).c_str(); std::string sval2; fieldstream fs1(R.front()[1]); fs1 >> sval2; PQXX_CHECK_EQUAL(sval2, sval, "fieldstream returned wrong value."); R = tx.exec("SELECT count(*) FROM pg_tables"); int ival; fieldstream fs2(R.at(0).at(0)); fs2 >> ival; PQXX_CHECK_EQUAL( ival, R.front().front().as(), "fieldstream::front() is broken."); double dval; (fieldstream(R.at(0).at(0))) >> dval; PQXX_CHECK_BOUNDS( dval, R[0][0].as() - 0.1, R[0][0].as() + 0.1, "Got wrong double from fieldstream."); const float roughpi = static_cast(3.1415926435); R = tx.exec("SELECT " + to_string(roughpi)); float pival; (fieldstream(R.at(0).at(0))) >> pival; PQXX_CHECK_BOUNDS( pival, roughpi - 0.001, roughpi + 0.001, "Pi approximation came back wrong from fieldstream."); PQXX_CHECK_EQUAL( to_string(R[0][0]), R[0][0].c_str(), "to_string(result::field) is inconsistent with c_str()."); float float_pi; from_string(to_string(roughpi), float_pi); PQXX_CHECK_BOUNDS( float_pi, roughpi - 0.00001, roughpi + 0.00001, "Float changed in conversion."); double double_pi; from_string(to_string(double(roughpi)), double_pi); PQXX_CHECK_BOUNDS( double_pi, roughpi - 0.00001, roughpi + 0.00001, "Double changed in conversion."); const long double ld = roughpi; long double long_double_pi; from_string(to_string(ld), long_double_pi); PQXX_CHECK_BOUNDS( long_double_pi, roughpi - 0.00001, roughpi + 0.00001, "long double changed in conversion."); } } // namespace PQXX_REGISTER_TEST(test_074); libpqxx-6.4.5/test/test75.cxx000066400000000000000000000075761350065432700160770ustar00rootroot00000000000000#include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Compare const_reverse_iterator iteration of a // result to a regular, const_iterator iteration. namespace { void test_075() { connection conn; work tx{conn}; test::create_pqxxevents(tx); const result R( tx.exec("SELECT year FROM pqxxevents") ); PQXX_CHECK(not R.empty(), "No events found, cannot test."); PQXX_CHECK_EQUAL(R[0], R.at(0), "Inconsistent result indexing."); PQXX_CHECK(not (R[0] != R.at(0)), "result::row::operator!=() is broken."); PQXX_CHECK_EQUAL(R[0][0], R[0].at(0), "Inconsistent row indexing."); PQXX_CHECK( not (R[0][0] != R[0].at(0)), "result::field::operator!=() is broken."); std::vector contents; for (const auto &i: R) contents.push_back(i.at(0).as()); std::cout << to_string(contents.size()) << " years read" << std::endl; PQXX_CHECK_EQUAL( contents.size(), std::vector::size_type(R.size()), "Number of values does not match result size."); for (result::size_type i=0; i ri2, "reverse_iterator operator>() is broken."); PQXX_CHECK(ri3 >= ri2, "reverse_iterator operator>=() is broken."); PQXX_CHECK(ri2 < ri3, "reverse_iterator operator<() is broken."); PQXX_CHECK(ri2 <= ri3, "reverse_iterator operator<=() is broken."); PQXX_CHECK(ri3 == ri2 + 1, "Adding int to reverse_iterator is broken."); PQXX_CHECK( ri2 == ri3 - 1, "Subtracting int from reverse_iterator is broken."); PQXX_CHECK(ri3 == ++ri2, "reverse_iterator pre-increment is broken."); PQXX_CHECK(ri3 >= ri2, "operator>=() breaks on equal reverse_iterators."); PQXX_CHECK(ri3 >= ri2, "operator<=() breaks on equal reverse_iterators."); PQXX_CHECK( ri3.base() == R.back(), "reverse_iterator does not arrive at back()."); PQXX_CHECK( ri1->at(0) == (*ri1).at(0), "reverse_iterator operator->() is inconsistent with operator*()."); PQXX_CHECK(ri2-- == ri3, "reverse_iterator post-decrement is broken."); PQXX_CHECK(ri2 == --ri3, "reverse_iterator pre-decrement is broken."); PQXX_CHECK(ri2 == R.rbegin(), "reverse_iterator decrement is broken."); ri2 += 1; ri3 -= -1; PQXX_CHECK(ri2 != R.rbegin(), "Adding to reverse_iterator does not work."); PQXX_CHECK( ri3 == ri2, "reverse_iterator operator-=() breaks on negative distances."); ri2 -= 1; PQXX_CHECK( ri2 == R.rbegin(), "reverse_iterator operator+=() and operator-=() do not cancel out."); // Now verify that reverse iterator also sees the same results... auto l = contents.rbegin(); for (auto i = R.rbegin(); i != R.rend(); ++i, ++l) PQXX_CHECK_EQUAL( *l, i->at(0).c_str(), "Inconsistent reverse iteration."); PQXX_CHECK(l == contents.rend(), "Reverse iteration ended too soon."); PQXX_CHECK(not R.empty(), "No events found in table, cannot test."); } } // namespace PQXX_REGISTER_TEST(test_075); libpqxx-6.4.5/test/test76.cxx000066400000000000000000000031241350065432700160610ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Simple test program for libpqxx. Test string conversion routines. namespace { void test_076() { connection conn; nontransaction tx{conn}; row RFalse = tx.exec1("SELECT 1=0"), RTrue = tx.exec1("SELECT 1=1"); bool False, True; from_string(RFalse[0], False); from_string(RTrue[0], True); PQXX_CHECK(not False, "False bool converted to true."); PQXX_CHECK(True, "True bool converted to false."); RFalse = tx.exec1("SELECT " + to_string(False)); RTrue = tx.exec1("SELECT " + to_string(True)); from_string(RFalse[0], False); from_string(RTrue[0], True); PQXX_CHECK(not False, "False bool converted to true."); PQXX_CHECK(True, "True bool converted to false."); const short svals[] = { -1, 1, 999, -32767, -32768, 32767, 0 }; for (int i=0; svals[i]; ++i) { short s; from_string(to_string(svals[i]), s); PQXX_CHECK_EQUAL(s, svals[i], "short/string conversion not bijective."); from_string(tx.exec("SELECT " + to_string(svals[i]))[0][0].c_str(), s); PQXX_CHECK_EQUAL(s, svals[i], "Roundtrip through backend changed short."); } const unsigned short uvals[] = { 1, 999, 32767, 32768, 65535, 0 }; for (int i=0; uvals[i]; ++i) { unsigned short u; from_string(to_string(uvals[i]), u); PQXX_CHECK_EQUAL( u, uvals[i], "unsigned short/string conversion not bijective."); from_string(tx.exec("SELECT " + to_string(uvals[i]))[0][0].c_str(), u); PQXX_CHECK_EQUAL( u, uvals[i], "Roundtrip through backend changed unsigned short."); } } } // namespace PQXX_REGISTER_TEST(test_076); libpqxx-6.4.5/test/test77.cxx000066400000000000000000000011271350065432700160630ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Test result::swap() namespace { void test_077() { connection conn; nontransaction tx{conn}; row RFalse = tx.exec1("SELECT 1=0"), RTrue = tx.exec1("SELECT 1=1"); bool f, t; from_string(RFalse[0], f); from_string(RTrue[0], t); PQXX_CHECK( not f and t, "Booleans converted incorrectly; can't trust this test."); RFalse.swap(RTrue); from_string(RFalse[0], f); from_string(RTrue[0], t); PQXX_CHECK(f and not t, "result::swap() is broken."); } } // namespace PQXX_REGISTER_TEST(test_077); libpqxx-6.4.5/test/test78.cxx000066400000000000000000000027541350065432700160730ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Send notification to self, using a notification // name with unusal characters, and without polling. namespace { // Sample implementation of notification receiver. class TestListener : public notification_receiver { bool m_done; public: explicit TestListener(connection_base &conn, std::string Name) : notification_receiver(conn, Name), m_done(false) { } virtual void operator()(const std::string &, int be_pid) override { m_done = true; PQXX_CHECK_EQUAL( be_pid, conn().backendpid(), "Got notification from wrong backend process."); std::cout << "Received notification: " << channel() << " pid=" << be_pid << std::endl; } bool done() const { return m_done; } }; void test_078() { connection conn; const std::string NotifName = "my listener"; TestListener L{conn, NotifName}; perform( [&conn, &L]() { work tx{conn}; tx.exec0("NOTIFY " + tx.quote_name(L.channel())); tx.commit(); }); int notifs = 0; for (int i=0; (i < 20) and not L.done(); ++i) { PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notifications."); std::cout << "."; notifs = conn.await_notification(); } std::cout << std::endl; PQXX_CHECK(L.done(), "No notification received."); PQXX_CHECK_EQUAL(notifs, 1, "Got unexpected number of notifications."); } } // namespace PQXX_REGISTER_TEST(test_078); libpqxx-6.4.5/test/test79.cxx000066400000000000000000000031171350065432700160660ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Example program for libpqxx. Test waiting for notification with timeout. namespace { // Sample implementation of notification receiver. class TestListener final : public notification_receiver { bool m_done; public: explicit TestListener(connection_base &conn, std::string Name) : notification_receiver(conn, Name), m_done(false) { } virtual void operator()(const std::string &, int be_pid) override { m_done = true; PQXX_CHECK_EQUAL( be_pid, conn().backendpid(), "Notification came from wrong backend."); std::cout << "Received notification: " << channel() << " pid=" << be_pid << std::endl; } bool done() const { return m_done; } }; void test_079() { connection conn; const std::string NotifName = "mylistener"; TestListener L(conn, NotifName); // First see if the timeout really works: we're not expecting any notifs int notifs = conn.await_notification(0, 1); PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notification."); perform( [&conn, &L]() { work tx{conn}; tx.exec0("NOTIFY " + L.channel()); tx.commit(); }); for (int i=0; (i < 20) and not L.done(); ++i) { PQXX_CHECK_EQUAL(notifs, 0, "Got notifications, but no handler called."); std::cout << "."; notifs = conn.await_notification(1,0); } std::cout << std::endl; PQXX_CHECK(L.done(), "No notifications received."); PQXX_CHECK_EQUAL(notifs, 1, "Got unexpected notifications."); } } // namespace PQXX_REGISTER_TEST(test_079); libpqxx-6.4.5/test/test82.cxx000066400000000000000000000116471350065432700160670ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Read and print table using row iterators. namespace { void test_082() { connection conn; nontransaction tx{conn}; test::create_pqxxevents(tx); const std::string Table = "pqxxevents"; result R{ tx.exec("SELECT * FROM " + Table) }; conn.disconnect(); PQXX_CHECK(not R.empty(), "Got empty result."); const std::string nullstr("[null]"); for (const auto &f: R[0]) std::cout << f.name() << '\t'; std::cout << std::endl << std::endl; for (const auto &r: R) { pqxx::row::const_iterator f2(r[0]); for (const auto &f: r) { std::cout << f.c_str() << '\t'; PQXX_CHECK_EQUAL( (*f2).as(nullstr), f.as(nullstr), "Inconsistent iteration result."); f2++; } PQXX_CHECK( r.begin() + pqxx::row::difference_type(r.size()) == r.end(), "Row end() appears to be in the wrong place."); PQXX_CHECK( pqxx::row::difference_type(r.size()) + r.begin() == r.end(), "Row iterator addition is not commutative."); PQXX_CHECK_EQUAL(r.begin()->num(), 0u, "Wrong column number at begin()."); pqxx::row::const_iterator f3(r[r.size()]); PQXX_CHECK(f3 == r.end(), "Did not get end() at end of row."); PQXX_CHECK(f3 > r.begin(), "Row end() appears to precede its begin()."); PQXX_CHECK( f3 >= r.end() and r.begin() < f3, "Row iterator operator<() is broken."); PQXX_CHECK(f3 > r.begin(), "Row end() not greater than begin()."); pqxx::row::const_iterator f4(r, r.size()); PQXX_CHECK(f4 == f3, "Row iterator constructor with offset is broken."); f3--; f4 -= 1; PQXX_CHECK(f3 < r.end(), "Last field in row is not before end()."); PQXX_CHECK(f3 >= r.begin(), "Last field in row precedes begin()."); PQXX_CHECK(f3 == r.end()-1, "Back from end() doese not yield end()-1."); PQXX_CHECK_EQUAL( r.end() - f3, 1, "Wrong distance from last row to end()."); PQXX_CHECK(f4 == f3, "Row iterator operator-=() is broken."); f4 += 1; PQXX_CHECK(f4 == r.end(), "Row iterator operator+=() is broken."); for (auto fr = r.rbegin(); fr != r.rend(); ++fr, --f3) PQXX_CHECK_EQUAL( *fr, *f3, "Reverse traversal is not consistent with forward traversal."); std::cout << std::endl; } // Thorough test for row::const_reverse_iterator pqxx::row::const_reverse_iterator ri1(R.front().rbegin()), ri2(ri1), ri3(R.front().end()); ri2 = R.front().rbegin(); PQXX_CHECK( ri1 == ri2, "Copy-constructed reverse_iterator is not equal to original."); PQXX_CHECK(ri2 == ri3, "result::end() does not generate rbegin()."); PQXX_CHECK_EQUAL( ri2 - ri3, 0, "Distance between identical const_reverse_iterators was nonzero."); PQXX_CHECK( pqxx::row::const_reverse_iterator(ri1.base()) == ri1, "Back-conversion of reverse_iterator base() fails."); PQXX_CHECK(ri2 == ri3 + 0, "reverse_iterator+0 gives strange result."); PQXX_CHECK(ri2 == ri3 - 0, "reverse_iterator-0 gives strange result."); PQXX_CHECK( not (ri3 < ri2), "reverse_iterator operator<() breaks on identical iterators."); PQXX_CHECK( ri2 <= ri3, "reverse_iterator operator<=() breaks on identical iterators."); PQXX_CHECK( ri3++ == ri2, "reverse_iterator post-increment is broken."); PQXX_CHECK_EQUAL(ri3 - ri2, 1, "Wrong reverse_iterator distance."); PQXX_CHECK(ri3 > ri2, "reverse_iterator operator>() is broken."); PQXX_CHECK(ri3 >= ri2, "reverse_iterator operator>=() is broken."); PQXX_CHECK(ri2 < ri3, "reverse_iterator operator<() is broken."); PQXX_CHECK(ri2 <= ri3, "reverse_iterator operator<=() is broken."); PQXX_CHECK(ri3 == ri2 + 1, "Adding number to reverse_iterator goes wrong."); PQXX_CHECK(ri2 == ri3 - 1, "Subtracting from reverse_iterator goes wrong."); PQXX_CHECK( ri3 == ++ri2, "reverse_iterator pre-incremen returns wrong result."); PQXX_CHECK( ri3 >= ri2, "reverse_iterator operator>=() breaks on equal iterators."); PQXX_CHECK( ri3 >= ri2, "reverse_iterator operator<=() breaks on equal iterators."); PQXX_CHECK( ri3.base() == R.front().back(), "reverse_iterator does not arrive at back()."); PQXX_CHECK( ri1->c_str()[0] == (*ri1).c_str()[0], "reverse_iterator operator->() is inconsistent with operator*()."); PQXX_CHECK( ri2-- == ri3, "reverse_iterator post-decrement returns wrong result."); PQXX_CHECK( ri2 == --ri3, "reverse_iterator pre-increment returns wrong result."); PQXX_CHECK( ri2 == R.front().rbegin(), "Moving iterator back and forth doesn't get it back to origin."); ri2 += 1; ri3 -= -1; PQXX_CHECK( ri2 != R.front().rbegin(), "Adding to reverse_iterator doesn't work."); PQXX_CHECK( ri2 != R.front().rbegin(), "Adding to reverse_iterator doesn't work."); PQXX_CHECK( ri3 == ri2, "reverse_iterator operator-=() breaks on negative numbers."); ri2 -= 1; PQXX_CHECK( ri2 == R.front().rbegin(), "reverse_iterator operator+=() and operator-=() do not cancel out"); } } // namespace PQXX_REGISTER_TEST(test_082); libpqxx-6.4.5/test/test84.cxx000066400000000000000000000056451350065432700160720ustar00rootroot00000000000000#include #include #include #include #include #include "test_helpers.hxx" using namespace pqxx; // "Adopted SQL Cursor" test program for libpqxx. Create SQL cursor, wrap it in // a cursor stream, then use it to fetch data and check for consistent results. // Compare results against an icursor_iterator so that is tested as well. namespace { void test_084() { connection conn; transaction tx{conn}; const std::string Table = "pg_tables", Key = "tablename"; // Count rows. result R( tx.exec("SELECT count(*) FROM " + Table) ); PQXX_CHECK( R.at(0).at(0).as() > 20, "Not enough rows in " + Table + ", cannot test."); // Create an SQL cursor and, for good measure, muddle up its state a bit. const std::string CurName = "MYCUR", Query = "SELECT * FROM " + Table + " ORDER BY " + Key; const int InitialSkip = 2, GetRows = 3; tx.exec0("DECLARE " + tx.quote_name(CurName) + " CURSOR FOR " + Query); tx.exec0( "MOVE " + to_string(InitialSkip*GetRows) + " " "IN " + tx.quote_name(CurName)); // Wrap cursor in cursor stream. Apply some trickery to get its name inside // a result field for this purpose. This isn't easy because it's not // supposed to be easy; normally we'd only construct streams around existing // SQL cursors if they were being returned by functions. icursorstream C{tx, tx.exec("SELECT '"+tx.esc(CurName)+"'")[0][0], GetRows}; // Create parallel cursor to check results icursorstream C2{tx, Query, "CHECKCUR", GetRows}; icursor_iterator i2{C2}; // Remember, our adopted cursor is at position (InitialSkip*GetRows) icursor_iterator i3(i2); PQXX_CHECK( (i3 == i2) and not (i3 != i2), "Equality on copy-constructed icursor_iterator is broken."); PQXX_CHECK( not (i3 > i2) and not (i3 < i2) and (i3 <= i2) and (i3 >= i2), "Comparison on identical icursor_iterators is broken."); i3 += InitialSkip; PQXX_CHECK(not (i3 <= i2), "icursor_iterator operator<=() is broken."); icursor_iterator iend, i4; PQXX_CHECK(i3 != iend, "Early end to icursor_iterator iteration."); i4 = iend; PQXX_CHECK(i4 == iend, "Assigning empty icursor_iterator fails."); // Now start testing our new Cursor. C >> R; i2 = i3; result R2( *i2++ ); PQXX_CHECK_EQUAL( R.size(), result::size_type(GetRows), "Got unexpected number of rows."); PQXX_CHECK_EQUAL(R, R2, "Unexpected result at [1]"); C.get(R); R2 = *i2; PQXX_CHECK_EQUAL(R, R2, "Unexpected result at [2]"); i2 += 1; C.ignore(GetRows); C.get(R); R2 = *++i2; PQXX_CHECK_EQUAL(R, R2, "Unexpected result at [3]"); ++i2; R2 = *i2++; for (int i=1; C.get(R) and i2 != iend; R2 = *i2++, ++i) PQXX_CHECK_EQUAL( R, R2, "Unexpected result in iteration at " + to_string(i)); PQXX_CHECK(i2 == iend, "Adopted cursor terminated early."); PQXX_CHECK(not (C >> R), "icursor_iterator terminated early."); } } // namespace PQXX_REGISTER_TEST(test_084); libpqxx-6.4.5/test/test86.cxx000066400000000000000000000016771350065432700160750ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test inhibition of connection reactivation namespace { void test_086() { connection conn; nontransaction tx1{conn}; const std::string Query = "SELECT * from pg_tables"; std::cout << "Some datum: " << tx1.exec(Query)[0][0] << std::endl; tx1.commit(); #include conn.inhibit_reactivation(true); conn.deactivate(); #include quiet_errorhandler d{conn}; { nontransaction tx2{conn, "tx2"}; PQXX_CHECK_THROWS( tx2.exec(Query), broken_connection, "Deactivated connection did not throw broken_connection on exec()."); } #include conn.inhibit_reactivation(false); #include work tx3{conn, "tx3"}; tx3.exec(Query); tx3.commit(); } } // namespace PQXX_REGISTER_TEST(test_086); libpqxx-6.4.5/test/test87.cxx000066400000000000000000000056311350065432700160700ustar00rootroot00000000000000#include #include #include #include #include #include "pqxx/config-public-compiler.h" #if defined(HAVE_SYS_SELECT_H) #include #else #include #if defined(HAVE_SYS_TIME_H) #include #endif #if defined(HAVE_UNISTD_H) #include #endif #if defined(_WIN32) #define NOMINMAX #include #endif #endif // HAVE_SYS_SELECT_H #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Send notification to self, and select() on socket // as returned by the connection to wait for it to come in. Normally one would // use connection_base::await_notification() for this, but the socket may be // needed for event loops waiting on multiple sources of events. namespace { // Sample implementation of notification receiver. class TestListener final : public notification_receiver { bool m_done; public: explicit TestListener(connection_base &conn, std::string Name) : notification_receiver(conn, Name), m_done(false) { } virtual void operator()(const std::string &, int be_pid) override { m_done = true; PQXX_CHECK_EQUAL( be_pid, conn().backendpid(), "Notification came from wrong backend process."); std::cout << "Received notification: " << channel() << " pid=" << be_pid << std::endl; } bool done() const { return m_done; } }; extern "C" { static void set_fdbit(fd_set &s, int b) { #ifdef _MSC_VER // Suppress pointless, unfixable warnings in Visual Studio. #pragma warning ( push ) #pragma warning ( disable: 4389 ) // Signed/unsigned mismatch. #pragma warning ( disable: 4127 ) // Conditional expression is constant. #endif // Do the actual work. FD_SET(b,&s); #ifdef _MSV_VER // Restore prevalent warning settings. #pragma warning ( pop ) #endif } } void test_087() { connection conn; const std::string NotifName = "my notification"; TestListener L{conn, NotifName}; perform( [&conn, &L]() { work tx{conn}; tx.exec0("NOTIFY " + tx.quote_name(L.channel())); tx.commit(); }); int notifs = 0; for (int i=0; (i < 20) and not L.done(); ++i) { PQXX_CHECK_EQUAL(notifs, 0, "Got unexpected notifications."); std::cout << "."; const int fd = conn.sock(); // File descriptor from which we wish to read. fd_set read_fds; FD_ZERO(&read_fds); set_fdbit(read_fds,fd); // File descriptor for which we want to see errors. We can't just use // the same fd_set for reading and errors: they're marked "restrict". fd_set except_fds; FD_ZERO(&except_fds); set_fdbit(except_fds,fd); timeval timeout = { 1, 0 }; select(fd+1, &read_fds, nullptr, &except_fds, &timeout); notifs = conn.get_notifs(); } std::cout << std::endl; PQXX_CHECK(L.done(), "No notification received."); PQXX_CHECK_EQUAL(notifs, 1, "Got unexpected number of notifications."); } } // namespace PQXX_REGISTER_TEST(test_087); libpqxx-6.4.5/test/test88.cxx000066400000000000000000000054331350065432700160710ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Attempt to perform nested transactions. namespace { void test_088() { connection conn; work tx0{conn}; test::create_pqxxevents(tx0); // Trivial test: create subtransactions, and commit/abort std::cout << tx0.exec1("SELECT 'tx0 starts'")[0].c_str() << std::endl; subtransaction T0a(static_cast(tx0), "T0a"); T0a.commit(); subtransaction T0b(static_cast(tx0), "T0b"); T0b.abort(); std::cout << tx0.exec1("SELECT 'tx0 ends'")[0].c_str() << std::endl; tx0.commit(); // Basic functionality: perform query in subtransaction; abort, continue work tx1{conn, "tx1"}; std::cout << tx1.exec1("SELECT 'tx1 starts'")[0].c_str() << std::endl; subtransaction tx1a{tx1, "tx1a"}; std::cout << tx1a.exec1("SELECT ' a'")[0].c_str() << std::endl; tx1a.commit(); subtransaction tx1b{tx1, "tx1b"}; std::cout << tx1b.exec1("SELECT ' b'")[0].c_str() << std::endl; tx1b.abort(); subtransaction tx1c{tx1, "tx1c"}; std::cout << tx1c.exec1("SELECT ' c'")[0].c_str() << std::endl; tx1c.commit(); std::cout << tx1.exec1("SELECT 'tx1 ends'")[0].c_str() << std::endl; tx1.commit(); // Commit/rollback functionality work tx2{conn, "tx2"}; const std::string Table = "test088"; tx2.exec0("CREATE TEMP TABLE " + Table + "(no INTEGER, text VARCHAR)"); tx2.exec0("INSERT INTO " + Table + " VALUES(1,'tx2')"); subtransaction tx2a{tx2, "tx2a"}; tx2a.exec0("INSERT INTO "+Table+" VALUES(2,'tx2a')"); tx2a.commit(); subtransaction tx2b{tx2, "tx2b"}; tx2b.exec0("INSERT INTO "+Table+" VALUES(3,'tx2b')"); tx2b.abort(); subtransaction tx2c{tx2, "tx2c"}; tx2c.exec0("INSERT INTO "+Table+" VALUES(4,'tx2c')"); tx2c.commit(); const result R = tx2.exec("SELECT * FROM " + Table + " ORDER BY no"); for (const auto &i: R) std::cout << '\t' << i[0].c_str() << '\t' << i[1].c_str() << std::endl; PQXX_CHECK_EQUAL(R.size(), 3u, "Wrong number of results."); int expected[3] = { 1, 2, 4 }; for (result::size_type n=0; n(), expected[n], "Hit unexpected row number."); tx2.abort(); // Auto-abort should only roll back the subtransaction. work tx3{conn, "tx3"}; subtransaction tx3a(tx3, "tx3a"); PQXX_CHECK_THROWS( tx3a.exec("SELECT * FROM nonexistent_table WHERE nonattribute=0"), sql_error, "Bogus query did not fail."); // Subtransaction can only be aborted now, because there was an error. tx3a.abort(); // We're back in our top-level transaction. This did not abort. tx3.exec1("SELECT count(*) FROM pqxxevents"); // Make sure we can commit exactly one more level of transaction. tx3.commit(); } } // namespace PQXX_REGISTER_TEST(test_088); libpqxx-6.4.5/test/test89.cxx000066400000000000000000000037421350065432700160730ustar00rootroot00000000000000#include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Attempt to perform nested queries on various types // of connections. namespace { void do_test(connection_base &C, const std::string &desc) { std::cout << "Testing " << desc << ":" << std::endl; // Trivial test: create subtransactions, and commit/abort work T0(C, "T0"); std::cout << T0.exec1("SELECT 'T0 starts'")[0].c_str() << std::endl; subtransaction T0a(T0, "T0a"); T0a.commit(); subtransaction T0b(T0, "T0b"); T0b.abort(); std::cout << T0.exec1("SELECT 'T0 ends'")[0].c_str() << std::endl; T0.commit(); // Basic functionality: perform query in subtransaction; abort, continue work T1(C, "T1"); std::cout << T1.exec1("SELECT 'T1 starts'")[0].c_str() << std::endl; subtransaction T1a(T1, "T1a"); std::cout << T1a.exec1("SELECT ' a'")[0].c_str() << std::endl; T1a.commit(); subtransaction T1b(T1, "T1b"); std::cout << T1b.exec1("SELECT ' b'")[0].c_str() << std::endl; T1b.abort(); subtransaction T1c(T1, "T1c"); std::cout << T1c.exec1("SELECT ' c'")[0].c_str() << std::endl; T1c.commit(); std::cout << T1.exec1("SELECT 'T1 ends'")[0].c_str() << std::endl; T1.commit(); } void test_089() { asyncconnection A1; do_test(A1, "asyncconnection (virgin)"); asyncconnection A2; #include A2.activate(); #include do_test(A2, "asyncconnection (initialized)"); lazyconnection L1; do_test(L1, "lazyconnection (virgin)"); lazyconnection L2; #include L2.activate(); #include do_test(L2, "lazyconnection (initialized)"); connection C; #include C.activate(); C.deactivate(); #include do_test(C, "connection (deactivated)"); } } // namespace PQXX_REGISTER_TEST(test_089); libpqxx-6.4.5/test/test90.cxx000066400000000000000000000006431350065432700160600ustar00rootroot00000000000000#include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Test adorn_name. namespace { void test_090() { connection conn; // Test connection's adorn_name() function for uniqueness const std::string nametest = "basename"; PQXX_CHECK_NOT_EQUAL(conn.adorn_name(nametest), conn.adorn_name(nametest), "\"Unique\" names are not unique."); } } // namespace PQXX_REGISTER_TEST(test_090); libpqxx-6.4.5/test/test92.cxx000066400000000000000000000040231350065432700160560ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Test binary parameters to prepared statements. namespace { void test_092() { lazyconnection conn; nontransaction tx{conn}; const char databuf[] = "Test\0data"; const std::string data(databuf, sizeof(databuf)); PQXX_CHECK(data.size() > strlen(databuf), "Unknown data length problem."); const std::string Table = "pqxxbin", Field = "binfield", Stat = "nully"; tx.exec0("CREATE TEMP TABLE " + Table + " (" + Field + " BYTEA)"); #include conn.prepare(Stat, "INSERT INTO " + Table + " VALUES ($1)"); tx.prepared(Stat)(binarystring(data)).exec(); const result L{ tx.exec("SELECT length("+Field+") FROM " + Table) }; PQXX_CHECK_EQUAL(L[0][0].as(), data.size(), "Length of field in database does not match original length."); const result R{ tx.exec("SELECT " + Field + " FROM " + Table) }; const binarystring roundtrip(R[0][0]); PQXX_CHECK_EQUAL( std::string{roundtrip.str()}, data, "Data came back different."); PQXX_CHECK_EQUAL(roundtrip.size(), data.size(), "Binary string reports wrong size."); // People seem to like the multi-line invocation style, where you get your // invocation object first, then add parameters in separate C++ statements. // As John Mudd found, that used to break the code. Let's test it. tx.exec0("CREATE TEMP TABLE row (one INTEGER, two VARCHAR)"); conn.prepare("makerow", "INSERT INTO row VALUES ($1, $2)"); pqxx::prepare::invocation i{ tx.prepared("makerow") }; const std::string f = "frobnalicious"; i(6); i(f); i.exec(); #include const result t{ tx.exec("SELECT * FROM row") }; PQXX_CHECK_EQUAL(t.size(), 1u, "Wrong result size."); PQXX_CHECK_EQUAL( t[0][0].as(), "6", "Unexpected result value."); PQXX_CHECK_EQUAL(t[0][1].c_str(), f, "Unexpected string result."); } } // namespace PQXX_REGISTER_TEST(test_092); libpqxx-6.4.5/test/test93.cxx000066400000000000000000000036521350065432700160660ustar00rootroot00000000000000#include #include #include #include "test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Test querying of result column origins. namespace { void test_093() { result R, X; { connection conn; work tx{conn}; tx.exec0("CREATE TEMP TABLE pqxxfoo (x varchar, y integer, z integer)"); tx.exec0("INSERT INTO pqxxfoo VALUES ('xx', 1, 2)"); R = tx.exec("SELECT z,y,x FROM pqxxfoo"); X = tx.exec("SELECT x,y,z,99 FROM pqxxfoo"); // tx and connection are closed here; result objects remain } pqxx::row::size_type x = R.table_column(2), y = R.table_column(1), z = R.table_column(int(0)); PQXX_CHECK_EQUAL(x, 0u, "Wrong column number."); PQXX_CHECK_EQUAL(y, 1u, "Wrong column number."); PQXX_CHECK_EQUAL(z, 2u, "Wrong column number."); x = R.table_column("x"); y = R.table_column("y"); z = R.table_column("z"); PQXX_CHECK_EQUAL(x, 0u, "Wrong number for named column."); PQXX_CHECK_EQUAL(y, 1u, "Wrong number for named column."); PQXX_CHECK_EQUAL(z, 2u, "Wrong number for named column."); pqxx::row::size_type xx = X[0].table_column(int(0)), yx = X[0].table_column(pqxx::row::size_type(1)), zx = X[0].table_column("z"); PQXX_CHECK_EQUAL(xx, 0u, "Bad result from table_column(int)."); PQXX_CHECK_EQUAL(yx, 1u, "Bad result from table_column(size_type)."); PQXX_CHECK_EQUAL(zx, 2u, "Bad result from table_column(string)."); for (pqxx::row::size_type i=0; i #include #include namespace pqxx { namespace test { class test_failure : public std::logic_error { const std::string m_file; int m_line; public: test_failure( const std::string &ffile, int fline, const std::string &desc); ~test_failure() noexcept; const std::string &file() const noexcept { return m_file; } int line() const noexcept { return m_line; } }; /// Drop a table, if it exists. void drop_table(transaction_base &, const std::string &table); using testfunc = void (*)(); void register_test(const char name[], testfunc func); /// Register a test while not inside a function. struct registrar { registrar(const char name[], testfunc func) { pqxx::test::register_test(name, func); } }; // Register a test function, so the runner will run it. #define PQXX_REGISTER_TEST(func) pqxx::test::registrar tst_##func{#func, func} // Unconditional test failure. #define PQXX_CHECK_NOTREACHED(desc) \ pqxx::test::check_notreached(__FILE__, __LINE__, (desc)) [[noreturn]] void check_notreached( \ const char file[], \ int line, \ std::string desc); // Verify that a condition is met, similar to assert() #define PQXX_CHECK(condition, desc) \ pqxx::test::check(__FILE__, __LINE__, (condition), #condition, (desc)) void check( const char file[], int line, bool condition, const char text[], std::string desc); // Verify that variable has the expected value. #define PQXX_CHECK_EQUAL(actual, expected, desc) \ pqxx::test::check_equal( \ __FILE__, \ __LINE__, \ (actual), \ #actual, \ (expected), \ #expected, \ (desc)) template inline void check_equal( const char file[], int line, ACTUAL actual, const char actual_text[], EXPECTED expected, const char expected_text[], const std::string &desc) { if (expected == actual) return; const std::string fulldesc = desc + " (" + actual_text + " <> " + expected_text + ": " "actual=" + to_string(actual) + ", " "expected=" + to_string(expected) + ")"; throw test_failure(file, line, fulldesc); } // Verify that two values are not equal. #define PQXX_CHECK_NOT_EQUAL(value1, value2, desc) \ pqxx::test::check_not_equal( \ __FILE__, \ __LINE__, \ (value1), \ #value1, \ (value2), \ #value2, \ (desc)) template inline void check_not_equal( const char file[], int line, VALUE1 value1, const char text1[], VALUE2 value2, const char text2[], const std::string &desc) { if (value1 != value2) return; const std::string fulldesc = desc + " (" + text1 + " == " + text2 + ": " "both are " + to_string(value2) + ")"; throw test_failure(file, line, fulldesc); } // Verify that value1 is less than value2. #define PQXX_CHECK_LESS(value1, value2, desc) \ pqxx::test::check_less( \ __FILE__, \ __LINE__, \ (value1), \ #value1, \ (value2), \ #value2, \ (desc)) template inline void check_less( const char file[], int line, VALUE1 value1, const char text1[], VALUE2 value2, const char text2[], const std::string &desc) { if (value1 < value2) return; const std::string fulldesc = desc + " (" + text1 + " >= " + text2 + ": " "\"lower\"=" + to_string(value1) + ", " "\"upper\"=" + to_string(value2) + ")"; throw test_failure(file, line, fulldesc); } struct failure_to_fail {}; namespace internal { /// Syntactic placeholder: require (and accept) semicolon after block. inline void end_of_statement() { } } // Verify that "action" throws an exception, of any std::exception-based type. #define PQXX_CHECK_THROWS_EXCEPTION(action, desc) \ { \ try \ { \ action ; \ throw pqxx::test::failure_to_fail(); \ } \ catch (const pqxx::test::failure_to_fail &) \ { \ PQXX_CHECK_NOTREACHED( \ std::string{desc} + " (\"" #action "\" did not throw)"); \ } \ catch (const std::exception &) {} \ catch (...) \ { \ PQXX_CHECK_NOTREACHED( \ std::string{desc} + \ " (\"" #action "\" threw non-exception type)"); \ } \ } \ pqxx::test::internal::end_of_statement() // Verify that "action" throws "exception_type" (which is not std::exception). #define PQXX_CHECK_THROWS(action, exception_type, desc) \ { \ try \ { \ action ; \ throw pqxx::test::failure_to_fail(); \ } \ catch (const pqxx::test::failure_to_fail &) \ { \ PQXX_CHECK_NOTREACHED( \ std::string{desc} + \ " (\"" #action "\" did not throw " #exception_type ")"); \ } \ catch (const exception_type &) {} \ catch (const std::exception &e) \ { \ PQXX_CHECK_NOTREACHED( \ std::string{desc} + \ " (\"" #action "\" " \ "threw exception other than " #exception_type ": " + \ e.what() + ")"); \ } \ catch (...) \ { \ PQXX_CHECK_NOTREACHED( \ std::string{desc} + \ " (\"" #action "\" threw non-exception type)"); \ } \ } \ pqxx::test::internal::end_of_statement() #define PQXX_CHECK_BOUNDS(value, lower, upper, desc) \ pqxx::test::check_bounds( \ __FILE__, \ __LINE__, \ (value), \ #value, \ (lower), \ #lower, \ (upper), \ #upper, \ (desc)) template inline void check_bounds( const char file[], int line, VALUE value, const char text[], LOWER lower, const char lower_text[], UPPER upper, const char upper_text[], const std::string &desc) { const std::string range_check = std::string{lower_text} + " < " + upper_text, lower_check = std::string{"!("} + text + " < " + lower_text + ")", upper_check = std::string{text} + " < " + upper_text; pqxx::test::check( file, line, lower < upper, range_check.c_str(), desc + " (acceptable range is empty; value was " + text + ")"); pqxx::test::check( file, line, not (value < lower), lower_check.c_str(), desc + " (" + text + " is below lower bound " + lower_text + ")"); pqxx::test::check( file, line, value < upper, upper_check.c_str(), desc + " (" + text + " is not below upper bound " + upper_text + ")"); } // Report expected exception void expected_exception(const std::string &); // Represent result row as string std::string list_row(row); // Represent result as string std::string list_result(result); // Represent result iterator as string std::string list_result_iterator(result::const_iterator); // @deprecated Set up test data for legacy tests. void create_pqxxevents(transaction_base &); } // namespace test // Support string conversion on result rows for debug output. template<> struct string_traits { static const char *name() { return "pqxx::row"; } static bool has_null() { return false; } static bool is_null(row) { return false; } static result null(); // Not needed static void from_string(const char Str[], result &Obj); // Not needed static std::string to_string(row Obj) { return pqxx::test::list_row(Obj); } }; // Support string conversion on result objects for debug output. template<> struct string_traits { static const char *name() { return "pqxx::result"; } static bool has_null() { return true; } static bool is_null(result r) { return r.empty(); } static result null() { return result(); } static void from_string(const char Str[], result &Obj); // Not needed static std::string to_string(result Obj) { return pqxx::test::list_result(Obj); } }; // Support string conversion on result::const_iterator for debug output. template<> struct string_traits { using subject_type = result::const_iterator; static const char *name() { return "pqxx::result::const_iterator"; } static bool has_null() { return false; } static bool is_null(subject_type) { return false; } static result null(); // Not needed static void from_string(const char Str[], subject_type &Obj); // Not needed static std::string to_string(subject_type Obj) { return pqxx::test::list_result_iterator(Obj); } }; // Support string conversion on vector for debug output. template<> struct string_traits> { using subject_type = std::vector; static const char *name() { return "vector"; } static bool has_null() { return false; } static bool is_null(subject_type) { return false; } static subject_type null(); // Not needed static void from_string(const char Str[], subject_type &Obj); // Not needed static std::string to_string(const subject_type &Obj) { return separated_list("; ", Obj); } }; } // namespace pqxx libpqxx-6.4.5/test/test_main.hxx000066400000000000000000000112021350065432700167110ustar00rootroot00000000000000/* main() definition for libpqxx test runners. */ #include #include #include #include #include #include "test_helpers.hxx" using namespace pqxx; using namespace pqxx::test; namespace { std::string deref_field(const field &f) { return f.c_str(); } } // namespace namespace pqxx { namespace test { test_failure::test_failure( const std::string &ffile, int fline, const std::string &desc) : logic_error(desc), m_file(ffile), m_line(fline) { } test_failure::~test_failure() noexcept {} /// Drop table, if it exists. void drop_table(transaction_base &t, const std::string &table) { t.exec("DROP TABLE IF EXISTS " + table); } [[noreturn]] void check_notreached( const char file[], int line, std::string desc) { throw test_failure(file, line, desc); } void check( const char file[], int line, bool condition, const char text[], std::string desc) { if (not condition) throw test_failure( file, line, desc + " (failed expression: " + text + ")"); } void expected_exception(const std::string &message) { std::cout << "(Expected) " << message << std::endl; } std::string list_row(row Obj) { return separated_list(", ", Obj.begin(), Obj.end(), deref_field); } std::string list_result(result Obj) { if (Obj.empty()) return ""; return "{" + separated_list("}\n{", Obj) + "}"; } std::string list_result_iterator(result::const_iterator Obj) { return ""; } void create_pqxxevents(transaction_base &t) { t.exec( "CREATE TEMP TABLE pqxxevents(year integer, event varchar) " "ON COMMIT PRESERVE ROWS"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (71, 'jtv')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (38, 'time_t overflow')"); t.exec( "INSERT INTO pqxxevents(year, event) VALUES (1, '''911'' WTC attack')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (81, 'C:\\>')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (1978, 'bloody\t\tcold')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (99, '')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (2002, 'libpqxx')"); t.exec( "INSERT INTO pqxxevents(year, event) " "VALUES (1989, 'Ode an die Freiheit')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (2001, 'New millennium')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (1974, '')"); t.exec("INSERT INTO pqxxevents(year, event) VALUES (97, 'Asian crisis')"); t.exec( "INSERT INTO pqxxevents(year, event) VALUES (2001, 'A Space Odyssey')"); } } // namespace pqxx::test } // namespace pqxx namespace { std::map *all_tests = nullptr; } // namespace namespace pqxx { namespace test { void register_test(const char name[], testfunc func) { if (all_tests == nullptr) { all_tests = new std::map(); } else { assert(all_tests->find(name) == all_tests->end()); } (*all_tests)[name] = func; } } // namespace pqxx::test } // namespace pqxx int main(int, const char *argv[]) { const char *const test_name = argv[1]; int test_count = 0; std::list failed; for (const auto &i: *all_tests) if (test_name == nullptr or std::string{test_name} == std::string{i.first}) { std::cout << std::endl << "Running: " << i.first << std::endl; bool success = false; try { i.second(); success = true; } catch (const test_failure &e) { std::cerr << "Test failure in " + e.file() + " line " + to_string(e.line()) << ": " << e.what() << std::endl; } catch (const std::bad_alloc &) { std::cerr << "Out of memory!" << std::endl; } catch (const feature_not_supported &e) { std::cerr << "Not testing unsupported feature: " << e.what() << std::endl; success = true; --test_count; } catch (const sql_error &e) { std::cerr << "SQL error: " << e.what() << std::endl << "Query was: " << e.query() << std::endl; } catch (const std::exception &e) { std::cerr << "Exception: " << e.what() << std::endl; } catch (...) { std::cerr << "Unknown exception" << std::endl; } if (not success) { std::cerr << "FAILED: " << i.first << std::endl; failed.push_back(i.first); } ++test_count; } std::cout << "Ran " << test_count << " test(s)." << std::endl; if (not failed.empty()) { std::cerr << "*** " << failed.size() << " test(s) failed: ***" << std::endl; for (const auto &i: failed) std::cerr << "\t" << i << std::endl; } return int(failed.size()); } libpqxx-6.4.5/test/unit/000077500000000000000000000000001350065432700151605ustar00rootroot00000000000000libpqxx-6.4.5/test/unit/CMakeLists.txt000066400000000000000000000034441350065432700177250ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './test/unit/CMakeLists.txt.template'. ################################################################################ if(NOT PostgreSQL_INCLUDE_DIRS) find_package(PostgreSQL REQUIRED) endif() # TODO: We're giving exact filenames here. Don't pretend they're globs. file( GLOB UNIT_TEST_SOURCES runner.cxx test_array.cxx test_binarystring.cxx test_cancel_query.cxx test_cursor.cxx test_encodings.cxx test_error_verbosity.cxx test_errorhandler.cxx test_escape.cxx test_exceptions.cxx test_float.cxx test_notification.cxx test_parameterized.cxx test_pipeline.cxx test_prepared_statement.cxx test_read_transaction.cxx test_result_iteration.cxx test_result_slicing.cxx test_row.cxx test_simultaneous_transactions.cxx test_sql_cursor.cxx test_stateless_cursor.cxx test_stream_from.cxx test_stream_to.cxx test_string_conversion.cxx test_subtransaction.cxx test_test_helpers.cxx test_thread_safety_model.cxx test_transaction_base.cxx test_transactor.cxx ) add_executable(unit_runner ${UNIT_TEST_SOURCES}) target_link_libraries(unit_runner PUBLIC pqxx_shared) target_include_directories(unit_runner PRIVATE ${PostgreSQL_INCLUDE_DIRS}) add_test( NAME unit_runner WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND unit_runner) libpqxx-6.4.5/test/unit/CMakeLists.txt.template000066400000000000000000000010661350065432700215350ustar00rootroot00000000000000if(NOT PostgreSQL_INCLUDE_DIRS) find_package(PostgreSQL REQUIRED) endif() # TODO: We're giving exact filenames here. Don't pretend they're globs. file( GLOB UNIT_TEST_SOURCES ###MAKTEMPLATE:FOREACH test/unit/*.cxx ###BASENAME###.cxx ###MAKTEMPLATE:ENDFOREACH ) add_executable(unit_runner ${UNIT_TEST_SOURCES}) target_link_libraries(unit_runner PUBLIC pqxx_shared) target_include_directories(unit_runner PRIVATE ${PostgreSQL_INCLUDE_DIRS}) add_test( NAME unit_runner WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND unit_runner) libpqxx-6.4.5/test/unit/Makefile.am000066400000000000000000000040771350065432700172240ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './test/unit/Makefile.am.template'. ################################################################################ #MAINTAINERCLEANFILES=Makefile.in EXTRA_DIST = Makefile.am.template # Use the serial test runner, so tests don't get run in parallel. Otherwise, # output from test failures will be hidden away in log files where we can't # see them when running in a build slave. AUTOMAKE_OPTIONS=serial-tests AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/test -I$(srcdir)/.. -I$(srcdir)/../../include ${POSTGRES_INCLUDE} DEFAULT_INCLUDES= MAINTAINERCLEANFILES=Makefile.in runner_SOURCES = \ test_array.cxx \ test_binarystring.cxx \ test_cancel_query.cxx \ test_cursor.cxx \ test_encodings.cxx \ test_error_verbosity.cxx \ test_errorhandler.cxx \ test_escape.cxx \ test_exceptions.cxx \ test_float.cxx \ test_notification.cxx \ test_parameterized.cxx \ test_pipeline.cxx \ test_prepared_statement.cxx \ test_read_transaction.cxx \ test_result_iteration.cxx \ test_result_slicing.cxx \ test_row.cxx \ test_simultaneous_transactions.cxx \ test_sql_cursor.cxx \ test_stateless_cursor.cxx \ test_stream_from.cxx \ test_stream_to.cxx \ test_string_conversion.cxx \ test_subtransaction.cxx \ test_test_helpers.cxx \ test_thread_safety_model.cxx \ test_transaction_base.cxx \ test_transactor.cxx \ runner.cxx runner_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} TESTS = runner check_PROGRAMS = ${TESTS} # ###MAKTEMPLATE:FOREACH test/unit/test_*.cxx # ###BASENAME###_SOURCES = ###BASENAME###.cxx # ###BASENAME###_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} libpqxx-6.4.5/test/unit/Makefile.am.template000066400000000000000000000015501350065432700210270ustar00rootroot00000000000000#MAINTAINERCLEANFILES=Makefile.in EXTRA_DIST = Makefile.am.template # Use the serial test runner, so tests don't get run in parallel. Otherwise, # output from test failures will be hidden away in log files where we can't # see them when running in a build slave. AUTOMAKE_OPTIONS=serial-tests AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/test -I$(srcdir)/.. -I$(srcdir)/../../include ${POSTGRES_INCLUDE} DEFAULT_INCLUDES= MAINTAINERCLEANFILES=Makefile.in runner_SOURCES = \ ###MAKTEMPLATE:FOREACH test/unit/test_*.cxx ###BASENAME###.cxx \ ###MAKTEMPLATE:ENDFOREACH runner.cxx runner_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} TESTS = runner check_PROGRAMS = ${TESTS} # ###MAKTEMPLATE:FOREACH test/unit/test_*.cxx # ###BASENAME###_SOURCES = ###BASENAME###.cxx # ###BASENAME###_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} libpqxx-6.4.5/test/unit/Makefile.in000066400000000000000000000645161350065432700172410ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './test/unit/Makefile.am.template'. ################################################################################ #MAINTAINERCLEANFILES=Makefile.in VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = runner$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) subdir = test/unit ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = runner$(EXEEXT) am_runner_OBJECTS = test_array.$(OBJEXT) test_binarystring.$(OBJEXT) \ test_cancel_query.$(OBJEXT) test_cursor.$(OBJEXT) \ test_encodings.$(OBJEXT) test_error_verbosity.$(OBJEXT) \ test_errorhandler.$(OBJEXT) test_escape.$(OBJEXT) \ test_exceptions.$(OBJEXT) test_float.$(OBJEXT) \ test_notification.$(OBJEXT) test_parameterized.$(OBJEXT) \ test_pipeline.$(OBJEXT) test_prepared_statement.$(OBJEXT) \ test_read_transaction.$(OBJEXT) \ test_result_iteration.$(OBJEXT) test_result_slicing.$(OBJEXT) \ test_row.$(OBJEXT) test_simultaneous_transactions.$(OBJEXT) \ test_sql_cursor.$(OBJEXT) test_stateless_cursor.$(OBJEXT) \ test_stream_from.$(OBJEXT) test_stream_to.$(OBJEXT) \ test_string_conversion.$(OBJEXT) test_subtransaction.$(OBJEXT) \ test_test_helpers.$(OBJEXT) test_thread_safety_model.$(OBJEXT) \ test_transaction_base.$(OBJEXT) test_transactor.$(OBJEXT) \ runner.$(OBJEXT) runner_OBJECTS = $(am_runner_OBJECTS) am__DEPENDENCIES_1 = runner_DEPENDENCIES = $(top_builddir)/src/libpqxx.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(runner_SOURCES) DIST_SOURCES = $(runner_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ EXTRA_DIST = Makefile.am.template # Use the serial test runner, so tests don't get run in parallel. Otherwise, # output from test failures will be hidden away in log files where we can't # see them when running in a build slave. AUTOMAKE_OPTIONS = serial-tests AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_builddir)/test -I$(srcdir)/.. -I$(srcdir)/../../include ${POSTGRES_INCLUDE} DEFAULT_INCLUDES = MAINTAINERCLEANFILES = Makefile.in runner_SOURCES = \ test_array.cxx \ test_binarystring.cxx \ test_cancel_query.cxx \ test_cursor.cxx \ test_encodings.cxx \ test_error_verbosity.cxx \ test_errorhandler.cxx \ test_escape.cxx \ test_exceptions.cxx \ test_float.cxx \ test_notification.cxx \ test_parameterized.cxx \ test_pipeline.cxx \ test_prepared_statement.cxx \ test_read_transaction.cxx \ test_result_iteration.cxx \ test_result_slicing.cxx \ test_row.cxx \ test_simultaneous_transactions.cxx \ test_sql_cursor.cxx \ test_stateless_cursor.cxx \ test_stream_from.cxx \ test_stream_to.cxx \ test_string_conversion.cxx \ test_subtransaction.cxx \ test_test_helpers.cxx \ test_thread_safety_model.cxx \ test_transaction_base.cxx \ test_transactor.cxx \ runner.cxx runner_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/unit/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/unit/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list runner$(EXEEXT): $(runner_OBJECTS) $(runner_DEPENDENCIES) $(EXTRA_runner_DEPENDENCIES) @rm -f runner$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(runner_OBJECTS) $(runner_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_binarystring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cancel_query.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_encodings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_error_verbosity.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_errorhandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_escape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_exceptions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_float.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_notification.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_parameterized.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_pipeline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_prepared_statement.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_read_transaction.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_result_iteration.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_result_slicing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_row.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_simultaneous_transactions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_sql_cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_stateless_cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_stream_from.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_stream_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_string_conversion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_subtransaction.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_test_helpers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_thread_safety_model.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_transaction_base.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_transactor.Po@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-checkPROGRAMS clean-generic clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # ###MAKTEMPLATE:FOREACH test/unit/test_*.cxx # ###BASENAME###_SOURCES = ###BASENAME###.cxx # ###BASENAME###_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/test/unit/runner.cxx000066400000000000000000000000341350065432700172120ustar00rootroot00000000000000#include "../test_main.hxx" libpqxx-6.4.5/test/unit/test_array.cxx000066400000000000000000000331111350065432700200600ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; // Test program for libpqxx array parsing. namespace { void test_empty_arrays() { std::pair output; // Parsing a null pointer just immediately returns "done". output = array_parser(nullptr).get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "get_next on null array did not return done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); // Parsing an empty array string immediately returns "done". output = array_parser("").get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "get_next on an empty array string did not return done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); // Parsing an empty array returns "row_start", "row_end", "done". array_parser empty_parser("{}"); output = empty_parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Empty array did not start with row_start."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = empty_parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Empty array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = empty_parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Empty array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_null_value() { std::pair output; array_parser containing_null("{NULL}"); output = containing_null.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array containing null did not start with row_start."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = containing_null.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::null_value), "Array containing null did not return null_value."); PQXX_CHECK_EQUAL(output.second, "", "Null value was not empty."); output = containing_null.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array containing null did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = containing_null.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array containing null did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_single_quoted_string() { std::pair output; array_parser parser("{'item'}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "item", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_single_quoted_escaping() { std::pair output; array_parser parser("{'don''t\\\\ care'}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL( output.second, "don't\\ care", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_double_quoted_string() { std::pair output; array_parser parser("{\"item\"}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "item", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_double_quoted_escaping() { std::pair output; array_parser parser("{\"don''t\\\\ care\"}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL( output.second, "don''t\\ care", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_unquoted_string() { std::pair output; array_parser parser("{item}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "item", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_multiple_values() { std::pair output; array_parser parser("{1,2}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "1", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "2", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_nested_array() { std::pair output; array_parser parser("{{item}}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Nested array did not start 2nd dimension with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "item", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Nested array did not end 2nd dimension with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_nested_array_with_multiple_entries() { std::pair output; array_parser parser("{{1,2},{3,4}}"); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Array did not start with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Nested array did not start 2nd dimension with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "1", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "2", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Nested array did not end 2nd dimension with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_start), "Nested array did not descend to 2nd dimension with row_start."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "3", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::string_value), "Array did not return string_value."); PQXX_CHECK_EQUAL(output.second, "4", "Unexpected string value."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Nested array did not leave 2nd dimension with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::row_end), "Array did not end with row_end."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); output = parser.get_next(); PQXX_CHECK_EQUAL( int(output.first), int(array_parser::juncture::done), "Array did not conclude with done."); PQXX_CHECK_EQUAL(output.second, "", "Unexpected nonempty output."); } void test_array_parse() { test_empty_arrays(); test_null_value(); test_single_quoted_string(); test_single_quoted_escaping(); test_double_quoted_string(); test_double_quoted_escaping(); test_unquoted_string(); test_multiple_values(); test_nested_array(); test_nested_array_with_multiple_entries(); } PQXX_REGISTER_TEST(test_array_parse); } // namespace libpqxx-6.4.5/test/unit/test_binarystring.cxx000066400000000000000000000101651350065432700214610ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { binarystring make_binarystring(transaction_base &T, std::string content) { return binarystring(T.exec("SELECT " + T.quote_raw(content))[0][0]); } void test_binarystring() { connection conn; work tx{conn}; binarystring b = make_binarystring(tx, ""); PQXX_CHECK(b.empty(), "Empty binarystring is not empty."); PQXX_CHECK_EQUAL(b.str(), "", "Empty binarystring doesn't work."); PQXX_CHECK_EQUAL(b.size(), 0u, "Empty binarystring has nonzero size."); PQXX_CHECK_EQUAL(b.length(), 0u, "Length/size mismatch."); PQXX_CHECK(b.begin() == b.end(), "Empty binarystring iterates."); PQXX_CHECK(b.cbegin() == b.begin(), "Wrong cbegin for empty binarystring."); PQXX_CHECK(b.rbegin() == b.rend(), "Empty binarystring reverse-iterates."); PQXX_CHECK( b.crbegin() == b.rbegin(), "Wrong crbegin for empty binarystring."); PQXX_CHECK_THROWS( b.at(0), std::out_of_range, "Empty binarystring accepts at()."); b = make_binarystring(tx, "z"); PQXX_CHECK_EQUAL(b.str(), "z", "Basic nonempty binarystring is broken."); PQXX_CHECK(not b.empty(), "Nonempty binarystring is empty."); PQXX_CHECK_EQUAL(b.size(), 1u, "Bad binarystring size."); PQXX_CHECK_EQUAL(b.length(), 1u, "Length/size mismatch."); PQXX_CHECK(b.begin() != b.end(), "Nonempty binarystring does not iterate."); PQXX_CHECK( b.rbegin() != b.rend(), "Nonempty binarystring does not reverse-iterate."); PQXX_CHECK(b.begin() + 1 == b.end(), "Bad iteration."); PQXX_CHECK(b.rbegin() + 1 == b.rend(), "Bad reverse iteration."); PQXX_CHECK(b.cbegin() == b.begin(), "Wrong cbegin."); PQXX_CHECK(b.cend() == b.end(), "Wrong cend."); PQXX_CHECK(b.crbegin() == b.rbegin(), "Wrong crbegin."); PQXX_CHECK(b.crend() == b.rend(), "Wrong crend."); PQXX_CHECK(b.front() == 'z', "Unexpected front()."); PQXX_CHECK(b.back() == 'z', "Unexpected back()."); PQXX_CHECK(b.at(0) == 'z', "Unexpected data at index 0."); PQXX_CHECK_THROWS(b.at(1), std::out_of_range, "Failed to catch range error."); const std::string simple("ab"); b = make_binarystring(tx, simple); PQXX_CHECK_EQUAL( b.str(), simple, "Binary (un)escaping went wrong somewhere."); PQXX_CHECK_EQUAL(b.size(), simple.size(), "Escaping confuses length."); const std::string simple_escaped(tx.esc_raw(simple)); for (std::string::size_type i=0; i(simple_escaped[i]); PQXX_CHECK(uc <= 127, "Non-ASCII byte in escaped string."); } PQXX_CHECK_EQUAL( tx.quote_raw( reinterpret_cast(simple.c_str()), simple.size()), tx.quote(b), "quote_raw is broken"); PQXX_CHECK_EQUAL( tx.quote(b), tx.quote_raw(simple), "Binary quoting is broken."); PQXX_CHECK_EQUAL( binarystring(tx.exec1("SELECT " + tx.quote(b))[0]).str(), simple, "Binary string is not idempotent."); const std::string bytes("\x01\x23\x23\xa1\x2b\x0c\xff"); b = make_binarystring(tx, bytes); PQXX_CHECK_EQUAL(b.str(), bytes, "Binary data breaks (un)escaping."); const std::string nully("a\0b", 3); b = make_binarystring(tx, nully); PQXX_CHECK_EQUAL(b.str(), nully, "Nul byte broke binary (un)escaping."); PQXX_CHECK_EQUAL(b.size(), 3u, "Nul byte broke binarystring size."); b = make_binarystring(tx, "foo"); PQXX_CHECK_EQUAL(std::string(b.get(), 3), "foo", "get() appears broken."); binarystring b1 = make_binarystring(tx, "1"), b2 = make_binarystring(tx, "2"); PQXX_CHECK_NOT_EQUAL(b1.get(), b2.get(), "Madness rules."); PQXX_CHECK_NOT_EQUAL(b1.str(), b2.str(), "Logic has no more meaning."); b1.swap(b2); PQXX_CHECK_NOT_EQUAL(b1.str(), b2.str(), "swap() equalized binarystrings."); PQXX_CHECK_NOT_EQUAL(b1.str(), "1", "swap() did not happen."); PQXX_CHECK_EQUAL(b1.str(), "2", "swap() is broken."); PQXX_CHECK_EQUAL(b2.str(), "1", "swap() went insane."); b = make_binarystring(tx, "bar"); b.swap(b); PQXX_CHECK_EQUAL(b.str(), "bar", "Self-swap confuses binarystring."); b = make_binarystring(tx, "\\x"); PQXX_CHECK_EQUAL(b.str(), "\\x", "Hex-escape header confused (un)escaping."); } PQXX_REGISTER_TEST(test_binarystring); } // namespace libpqxx-6.4.5/test/unit/test_cancel_query.cxx000066400000000000000000000007701350065432700214210ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_cancel_query() { connection conn; work tx{conn}; // Calling cancel_query() while none is in progress has no effect. conn.cancel_query(); // Nothing much is guaranteed about cancel_query, except that it doesn't make // the process die in flames. pipeline p{tx, "test_cancel_query"}; p.retain(0); p.insert("SELECT pg_sleep(1)"); conn.cancel_query(); } PQXX_REGISTER_TEST(test_cancel_query); } // namespace libpqxx-6.4.5/test/unit/test_cursor.cxx000066400000000000000000000025431350065432700202640ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_stateless_cursor_provides_random_access(connection_base &conn) { work tx{conn}; stateless_cursor c{ tx, "SELECT * FROM generate_series(0, 3)", "count", false}; auto r = c.retrieve(1, 2); PQXX_CHECK_EQUAL(r.size(), 1u, "Wrong number of rows from retrieve()."); PQXX_CHECK_EQUAL(r[0][0].as(), 1, "Cursor retrieved wrong data."); r = c.retrieve(3, 10); PQXX_CHECK_EQUAL(r.size(), 1u, "Expected 1 row retrieving past end."); PQXX_CHECK_EQUAL(r[0][0].as(), 3, "Wrong data retrieved at end."); r = c.retrieve(0, 1); PQXX_CHECK_EQUAL(r.size(), 1u, "Wrong number of rows back at beginning."); PQXX_CHECK_EQUAL(r[0][0].as(), 0, "Wrong data back at beginning."); } void test_stateless_cursor_ignores_trailing_semicolon(connection_base &conn) { work tx{conn}; stateless_cursor c{ tx, "SELECT * FROM generate_series(0, 3) ;; ; \n \t ", "count", false}; auto r = c.retrieve(1, 2); PQXX_CHECK_EQUAL(r.size(), 1u, "Trailing semicolon confused retrieve()."); } void test_cursor() { connection conn; test_stateless_cursor_provides_random_access(conn); test_stateless_cursor_ignores_trailing_semicolon(conn); } PQXX_REGISTER_TEST(test_cursor); } // namespace libpqxx-6.4.5/test/unit/test_encodings.cxx000066400000000000000000000057711350065432700207260ustar00rootroot00000000000000#include "../test_helpers.hxx" #include "pqxx/internal/encodings.hxx" namespace { void test_scan_ascii() { const auto scan = pqxx::internal::get_glyph_scanner( pqxx::internal::encoding_group::MONOBYTE); const std::string text{"hello"}; PQXX_CHECK_EQUAL( scan(text.c_str(), text.size(), 0), 1ul, "Monobyte scanner acting up."); PQXX_CHECK_EQUAL( scan(text.c_str(), text.size(), 1), 2ul, "Monobyte scanner is inconsistent."); } void test_scan_utf8() { const auto scan = pqxx::internal::get_glyph_scanner( pqxx::internal::encoding_group::UTF8); // Thai: "Khrab". const std::string text{ "\xe0\xb8\x95\xe0\xb8\xa3\xe0\xb8\xb1\xe0\xb8\x9a"}; PQXX_CHECK_EQUAL( scan(text.c_str(), text.size(), 0), 3ul, "UTF-8 scanner mis-scanned Thai khor khwai."); PQXX_CHECK_EQUAL( scan(text.c_str(), text.size(), 3), 6ul, "UTF-8 scanner mis-scanned Thai ror reua."); } void test_for_glyphs_empty() { bool iterated = false; pqxx::internal::for_glyphs( pqxx::internal::encoding_group::MONOBYTE, [&iterated](const char *, const char *){ iterated = true; }, "", 0); PQXX_CHECK(!iterated, "Empty string went through an iteration."); } void test_for_glyphs_ascii() { const std::string text{"hi"}; std::vector points; pqxx::internal::for_glyphs( pqxx::internal::encoding_group::UTF8, [&points](const char *gbegin, const char *gend){ points.push_back(gend - gbegin); }, text.c_str(), text.size()); PQXX_CHECK_EQUAL(points.size(), 2u, "Wrong number of ASCII iterations."); PQXX_CHECK_EQUAL(points[0], 1u, "ASCII iteration started off wrong."); PQXX_CHECK_EQUAL(points[1], 1u, "ASCII iteration was inconsistent."); } void test_for_glyphs_utf8() { // Greek: alpha omega. const std::string text{"\xce\x91\xce\xa9"}; std::vector points; pqxx::internal::for_glyphs( pqxx::internal::encoding_group::UTF8, [&points](const char *gbegin, const char *gend){ points.push_back(gend - gbegin); }, text.c_str(), text.size()); PQXX_CHECK_EQUAL(points.size(), 2u, "Wrong number of UTF-8 iterations."); PQXX_CHECK_EQUAL(points[0], 2u, "UTF-8 iteration started off wrong."); PQXX_CHECK_EQUAL(points[1], 2u, "ASCII iteration was inconsistent."); // Greek lambda, ASCII plus sign, Old Persian Gu. const std::string mix{"\xce\xbb+\xf0\x90\x8e\xa6"}; points.clear(); pqxx::internal::for_glyphs( pqxx::internal::encoding_group::UTF8, [&points](const char *gbegin, const char *gend){ points.push_back(gend - gbegin); }, mix.c_str(), mix.size()); PQXX_CHECK_EQUAL(points.size(), 3u, "Mixed UTF-8 iteration is broken."); PQXX_CHECK_EQUAL(points[0], 2u, "Mixed UTF-8 iteration started off wrong."); PQXX_CHECK_EQUAL(points[1], 1u, "Mixed UTF-8 iteration got ASCII wrong."); PQXX_CHECK_EQUAL(points[2], 4u, "Mixed UTF-8 iteration got long char wrong."); } void test_encodings() { test_scan_ascii(); test_scan_utf8(); test_for_glyphs_empty(); test_for_glyphs_ascii(); test_for_glyphs_utf8(); } PQXX_REGISTER_TEST(test_encodings); } // namespace libpqxx-6.4.5/test/unit/test_error_verbosity.cxx000066400000000000000000000015561350065432700222110ustar00rootroot00000000000000#include "../test_helpers.hxx" extern "C" { #include "libpq-fe.h" } using namespace pqxx; namespace { void test_error_verbosity() { PQXX_CHECK_EQUAL( int(connection_base::terse), int(PQERRORS_TERSE), "error_verbosity enum should match PGVerbosity."); PQXX_CHECK_EQUAL( int(connection_base::normal), int(PQERRORS_DEFAULT), "error_verbosity enum should match PGVerbosity."); PQXX_CHECK_EQUAL( int(connection_base::verbose), int(PQERRORS_VERBOSE), "error_verbosity enum should match PGVerbosity."); connection conn; PQXX_CHECK_EQUAL( int(conn.get_verbosity()), int(connection_base::normal), "Unexpected initial error verbosity."); conn.set_verbosity(connection_base::terse); PQXX_CHECK_EQUAL( int(conn.get_verbosity()), int(connection_base::terse), "Setting verbosity did not work."); } PQXX_REGISTER_TEST(test_error_verbosity); } // namespace libpqxx-6.4.5/test/unit/test_errorhandler.cxx000066400000000000000000000140441350065432700214350ustar00rootroot00000000000000#include #include "../test_helpers.hxx" using namespace pqxx; namespace { class TestErrorHandler final : public errorhandler { public: TestErrorHandler( connection_base &c, std::vector &activated_handlers, bool retval=true) : errorhandler(c), return_value(retval), message(), handler_list(activated_handlers) {} virtual bool operator()(const char msg[]) noexcept override { message = std::string{msg}; handler_list.push_back(this); return return_value; } bool return_value; std::string message; std::vector &handler_list; }; } // Support printing of TestErrorHandler. namespace pqxx { template<> struct string_traits { static const char *name() { return "TestErrorHandler"; } static bool has_null() { return true; } static bool is_null(TestErrorHandler *t) { return t == nullptr; } static std::string to_string(TestErrorHandler *t) { return "TestErrorHandler at " + pqxx::to_string(ptrdiff_t(t)); } }; } namespace { void test_process_notice_calls_errorhandler(connection_base &c) { std::vector dummy; TestErrorHandler handler(c, dummy); c.process_notice("Error!\n"); PQXX_CHECK_EQUAL(handler.message, "Error!\n", "Error not handled."); } void test_error_handlers_get_called_newest_to_oldest(connection_base &c) { std::vector handlers; TestErrorHandler h1(c, handlers); TestErrorHandler h2(c, handlers); TestErrorHandler h3(c, handlers); c.process_notice("Warning.\n"); PQXX_CHECK_EQUAL(h3.message, "Warning.\n", "Message not handled."); PQXX_CHECK_EQUAL(h2.message, "Warning.\n", "Broken handling chain."); PQXX_CHECK_EQUAL(h1.message, "Warning.\n", "Insane handling chain."); PQXX_CHECK_EQUAL(handlers.size(), 3u, "Wrong number of handler calls."); PQXX_CHECK_EQUAL(&h3, handlers[0], "Unexpected handling order."); PQXX_CHECK_EQUAL(&h2, handlers[1], "Insane handling order."); PQXX_CHECK_EQUAL(&h1, handlers[2], "Impossible handling order."); } void test_returning_false_stops_error_handling(connection_base &c) { std::vector handlers; TestErrorHandler starved(c, handlers); TestErrorHandler blocker(c, handlers, false); c.process_notice("Error output.\n"); PQXX_CHECK_EQUAL(handlers.size(), 1u, "Handling chain was not stopped."); PQXX_CHECK_EQUAL(handlers[0], &blocker, "Wrong handler got message."); PQXX_CHECK_EQUAL(blocker.message, "Error output.\n", "Didn't get message."); PQXX_CHECK_EQUAL(starved.message, "", "Message received; it shouldn't be."); } void test_destroyed_error_handlers_are_not_called(connection_base &c) { std::vector handlers; { TestErrorHandler doomed(c, handlers); } c.process_notice("Unheard output."); PQXX_CHECK(handlers.empty(), "Message was received on dead errorhandler."); } void test_destroying_connection_unregisters_handlers() { TestErrorHandler *survivor; std::vector handlers; { connection c; survivor = new TestErrorHandler(c, handlers); } // Make some pointless use of survivor just to prove that this doesn't crash. (*survivor)("Hi"); PQXX_CHECK_EQUAL( handlers.size(), 1u, "Ghost of dead ex-connection haunts handler."); delete survivor; } class MinimalErrorHandler final : public errorhandler { public: explicit MinimalErrorHandler(connection_base &c) : errorhandler(c) {} virtual bool operator()(const char[]) noexcept override { return true; } }; void test_get_errorhandlers(connection_base &c) { MinimalErrorHandler *eh3 = nullptr; const std::vector handlers_before = c.get_errorhandlers(); const size_t base_handlers = handlers_before.size(); { MinimalErrorHandler eh1(c); const std::vector handlers_with_eh1 = c.get_errorhandlers(); PQXX_CHECK_EQUAL( handlers_with_eh1.size(), base_handlers + 1, "Registering a handler didn't create exactly one handler."); PQXX_CHECK_EQUAL( size_t(*handlers_with_eh1.rbegin()), size_t(&eh1), "Wrong handler or wrong order."); { MinimalErrorHandler eh2(c); const std::vector handlers_with_eh2 = c.get_errorhandlers(); PQXX_CHECK_EQUAL( handlers_with_eh2.size(), base_handlers + 2, "Adding second handler didn't work."); PQXX_CHECK_EQUAL( size_t(*(handlers_with_eh2.rbegin() + 1)), size_t(&eh1), "Second handler upset order."); PQXX_CHECK_EQUAL( size_t(*handlers_with_eh2.rbegin()), size_t(&eh2), "Second handler isn't right."); } const std::vector handlers_without_eh2 = c.get_errorhandlers(); PQXX_CHECK_EQUAL( handlers_without_eh2.size(), base_handlers + 1, "Handler destruction produced wrong-sized handlers list."); PQXX_CHECK_EQUAL( size_t(*handlers_without_eh2.rbegin()), size_t(&eh1), "Destroyed wrong handler."); eh3 = new MinimalErrorHandler(c); const std::vector handlers_with_eh3 = c.get_errorhandlers(); PQXX_CHECK_EQUAL( handlers_with_eh3.size(), base_handlers + 2, "Remove-and-add breaks."); PQXX_CHECK_EQUAL( size_t(*handlers_with_eh3.rbegin()), size_t(eh3), "Added wrong third handler."); } const std::vector handlers_without_eh1 = c.get_errorhandlers(); PQXX_CHECK_EQUAL( handlers_without_eh1.size(), base_handlers + 1, "Destroying oldest handler didn't work as expected."); PQXX_CHECK_EQUAL( size_t(*handlers_without_eh1.rbegin()), size_t(eh3), "Destroyed wrong handler."); delete eh3; const std::vector handlers_without_all = c.get_errorhandlers(); PQXX_CHECK_EQUAL( handlers_without_all.size(), base_handlers, "Destroying all custom handlers didn't work as expected."); } void test_errorhandler() { connection conn; test_process_notice_calls_errorhandler(conn); test_error_handlers_get_called_newest_to_oldest(conn); test_returning_false_stops_error_handling(conn); test_destroyed_error_handlers_are_not_called(conn); test_destroying_connection_unregisters_handlers(); test_get_errorhandlers(conn); } PQXX_REGISTER_TEST(test_errorhandler); } // namespace libpqxx-6.4.5/test/unit/test_escape.cxx000066400000000000000000000071621350065432700202110ustar00rootroot00000000000000#include #include "../test_helpers.hxx" using namespace pqxx; namespace { void compare_esc(connection_base &c, transaction_base &t, const char str[]) { const size_t len = std::string{str}.size(); PQXX_CHECK_EQUAL(c.esc(str, len), t.esc(str, len), "Connection & transaction escape differently."); PQXX_CHECK_EQUAL(t.esc(str, len), t.esc(str), "Length argument to esc() changes result."); PQXX_CHECK_EQUAL(t.esc(std::string{str}), t.esc(str), "esc(std::string()) differs from esc(const char[])."); PQXX_CHECK_EQUAL(str, t.exec("SELECT '" + t.esc(str, len) + "'")[0][0].as(), "esc() is not idempotent."); PQXX_CHECK_EQUAL(t.esc(str, len), t.esc(str), "Oversized buffer affects esc()."); } void test_esc(connection_base &c, transaction_base &t) { PQXX_CHECK_EQUAL(t.esc("", 0), "", "Empty string doesn't escape properly."); PQXX_CHECK_EQUAL(t.esc("'", 1), "''", "Single quote escaped incorrectly."); const char *const escstrings[] = { "x", " ", "", nullptr }; for (size_t i=0; escstrings[i]; ++i) compare_esc(c, t, escstrings[i]); } void test_quote(connection_base &c, transaction_base &t) { PQXX_CHECK_EQUAL(t.quote("x"), "'x'", "Basic quote() fails."); PQXX_CHECK_EQUAL(t.quote(1), "'1'", "quote() not dealing with int properly."); PQXX_CHECK_EQUAL(t.quote(0), "'0'", "Quoting zero is a problem."); const char *const null_ptr = nullptr; PQXX_CHECK_EQUAL(t.quote(null_ptr), "NULL", "Not quoting NULL correctly."); PQXX_CHECK_EQUAL( t.quote(std::string{"'"}), "''''", "Escaping quotes goes wrong."); PQXX_CHECK_EQUAL(t.quote("x"), c.quote("x"), "Connection and transaction quote differently."); const char *test_strings[] = { "", "x", "\\", "\\\\", "'", "''", "\\'", "\t", "\n", nullptr }; for (size_t i=0; test_strings[i]; ++i) { result r = t.exec("SELECT " + t.quote(test_strings[i])); PQXX_CHECK_EQUAL( r[0][0].as(), test_strings[i], "Selecting quoted string does not come back equal."); } } void test_quote_name(transaction_base &t) { PQXX_CHECK_EQUAL( "\"A b\"", t.quote_name("A b"), "Escaped identifier is not as expected."); PQXX_CHECK_EQUAL( std::string{"A b"}, t.exec("SELECT 1 AS " + t.quote_name("A b")).column_name(0), "Escaped identifier does not work in SQL."); } void test_esc_raw_unesc_raw(transaction_base &t) { const char binary[] = "1\0023\\4x5"; const std::string data(binary, sizeof(binary)); const std::string escaped = t.esc_raw(data); std::cout << "Escaped data: " << escaped << std::endl; for (const auto i: escaped) PQXX_CHECK(isascii(i), "Non-ASCII character in escaped data: " + escaped); for (const auto i: escaped) PQXX_CHECK( isprint(i), "Unprintable character in escaped data: " + escaped); PQXX_CHECK_EQUAL( t.unesc_raw(escaped), data, "Unescaping binary data does not undo escaping it."); } void test_esc_like(transaction_base &tx) { PQXX_CHECK_EQUAL(tx.esc_like(""), "", "esc_like breaks on empty string."); PQXX_CHECK_EQUAL(tx.esc_like("abc"), "abc", "esc_like is broken."); PQXX_CHECK_EQUAL(tx.esc_like("_"), "\\_", "esc_like fails on underscore."); PQXX_CHECK_EQUAL(tx.esc_like("%"), "\\%", "esc_like fails on %."); PQXX_CHECK_EQUAL( tx.esc_like("a%b_c"), "a\\%b\\_c", "esc_like breaks on mix."); PQXX_CHECK_EQUAL( tx.esc_like("_", '+'), "+_", "esc_like ignores escape character."); } void test_escaping() { connection conn; work tx{conn}; test_esc(conn, tx); test_quote(conn, tx); test_quote_name(tx); test_esc_raw_unesc_raw(tx); test_esc_like(tx); } PQXX_REGISTER_TEST(test_escaping); } // namespace libpqxx-6.4.5/test/unit/test_exceptions.cxx000066400000000000000000000017041350065432700211260ustar00rootroot00000000000000#include "../test_helpers.hxx" #include using namespace pqxx; namespace { void test_exceptions() { const std::string broken_query = "SELECT HORRIBLE ERROR", err = "Error message"; try { throw sql_error(err, broken_query); } catch (const pqxx_exception &e) { PQXX_CHECK_EQUAL(e.base().what(), err, "Exception contains wrong message."); const sql_error *downcast = dynamic_cast(&e.base()); PQXX_CHECK(downcast, "pqxx_exception-to-sql_error downcast is broken."); PQXX_CHECK_EQUAL( downcast->query(), broken_query, "Getting query from pqxx_exception is broken."); } connection conn; work tx{conn}; try { tx.exec("INVALID QUERY HERE"); } catch (const syntax_error &e) { // SQL syntax error has sqlstate error 42601. PQXX_CHECK_EQUAL( e.sqlstate(), "42601", "Unexpected sqlstate on syntax error."); } } PQXX_REGISTER_TEST(test_exceptions); } // namespace libpqxx-6.4.5/test/unit/test_float.cxx000066400000000000000000000015121350065432700200470ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { template T make_infinity() { return std::numeric_limits::infinity(); } /// Test conversions for some floating-point type. template void infinity_test() { T inf = make_infinity(); std::string inf_string; T back_conversion; inf_string = to_string(inf); from_string(inf_string, back_conversion); PQXX_CHECK_LESS( T(999999999), back_conversion, "Infinity doesn't convert back to something huge."); inf_string = to_string(-inf); from_string(inf_string, back_conversion); PQXX_CHECK_LESS( back_conversion, -T(999999999), "Negative infinity is broken"); } void test_infinities() { infinity_test(); infinity_test(); infinity_test(); } PQXX_REGISTER_TEST(test_infinities); } // namespace libpqxx-6.4.5/test/unit/test_notification.cxx000066400000000000000000000032721350065432700214350ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { class TestReceiver final : public notification_receiver { public: std::string payload; int backend_pid; TestReceiver(connection_base &c, const std::string &channel_name) : notification_receiver(c, channel_name), payload(), backend_pid(0) { } virtual void operator()(const std::string &payload_string, int backend) override { this->payload = payload_string; this->backend_pid = backend; } }; void test_receive( transaction_base &t, const std::string &channel, const char payload[] = nullptr) { connection_base &conn(t.conn()); std::string SQL = "NOTIFY \"" + channel + "\""; if (payload) SQL += ", " + t.quote(payload); TestReceiver receiver(t.conn(), channel); // Clear out any previously pending notifications that might otherwise // confuse the test. conn.get_notifs(); // Notify, and receive. t.exec(SQL); t.commit(); int notifs = 0; for ( int i=0; (i < 10) and (notifs == 0); ++i, pqxx::internal::sleep_seconds(1)) notifs = conn.get_notifs(); PQXX_CHECK_EQUAL(notifs, 1, "Got wrong number of notifications."); PQXX_CHECK_EQUAL(receiver.backend_pid, conn.backendpid(), "Bad pid."); if (payload) PQXX_CHECK_EQUAL(receiver.payload, payload, "Bad payload."); else PQXX_CHECK(receiver.payload.empty(), "Unexpected payload."); } void test_notification() { connection conn; TestReceiver receiver(conn, "mychannel"); PQXX_CHECK_EQUAL(receiver.channel(), "mychannel", "Bad channel."); work tx{conn}; test_receive(tx, "channel1"); nontransaction u(conn); test_receive(u, "channel2", "payload"); } PQXX_REGISTER_TEST(test_notification); } // namespace libpqxx-6.4.5/test/unit/test_parameterized.cxx000066400000000000000000000013221350065432700215750ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_exec_params() { connection conn; work tx{conn}; #include result r = tx.parameterized("SELECT $1 + 1")(12).exec(); #include PQXX_CHECK_EQUAL( r[0][0].as(), 13, "Bad outcome from parameterized statement."); #include r = tx.parameterized("SELECT $1 || 'bar'")("foo").exec(); #include PQXX_CHECK_EQUAL( r[0][0].as(), "foobar", "Incorrect string result from parameterized statement."); } PQXX_REGISTER_TEST(test_exec_params); } // namespace libpqxx-6.4.5/test/unit/test_pipeline.cxx000066400000000000000000000033051350065432700205510ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_pipeline() { connection conn; work tx{conn}; // A pipeline grabs transaction focus, blocking regular queries and such. pipeline pipe(tx, "test_pipeline_detach"); PQXX_CHECK_THROWS( tx.exec("SELECT 1"), std::logic_error, "Pipeline does not block regular queries"); // Flushing a pipeline relinquishes transaction focus. pipe.flush(); result r = tx.exec("SELECT 2"); PQXX_CHECK_EQUAL(r.size(), 1u, "Wrong query result after flushing pipeline."); PQXX_CHECK_EQUAL( r[0][0].as(), 2, "Query returns wrong data after flushing pipeline."); // Inserting a query makes the pipeline grab transaction focus back. pipeline::query_id q = pipe.insert("SELECT 2"); PQXX_CHECK_THROWS( tx.exec("SELECT 3"), std::logic_error, "Pipeline does not block regular queries"); // Invoking complete() also detaches the pipeline from the transaction. pipe.complete(); r = tx.exec("SELECT 4"); PQXX_CHECK_EQUAL(r.size(), 1u, "Wrong query result after complete()."); PQXX_CHECK_EQUAL( r[0][0].as(), 4, "Query returns wrong data after complete()."); // The complete() also received any pending query results from the backend. r = pipe.retrieve(q); PQXX_CHECK_EQUAL(r.size(), 1u, "Wrong result from pipeline."); PQXX_CHECK_EQUAL( r[0][0].as(), 2, "Pipeline returned wrong data."); // We can cancel while the pipe is empty, and things will still work. pipe.cancel(); // Issue a query and cancel it. pipe.retain(0); pipe.insert("pg_sleep(10)"); pipe.cancel(); // TODO: Measure time to ensure we don't really wait. } } // namespace PQXX_REGISTER_TEST(test_pipeline); libpqxx-6.4.5/test/unit/test_prepared_statement.cxx000066400000000000000000000271241350065432700226370ustar00rootroot00000000000000#include #include #include #include #include "../test_helpers.hxx" using namespace pqxx; // Test program for libpqxx. Define and use prepared statements. #define COMPARE_RESULTS(name, lhs, rhs) \ PQXX_CHECK_EQUAL( \ rhs, \ lhs, \ "Executing " name " as prepared statement yields different results."); namespace { std::string stringize(transaction_base &t, const std::string &arg) { return "'" + t.esc(arg) + "'"; } template std::string stringize(transaction_base &t, T i) { return stringize(t, to_string(i)); } // Substitute variables in raw query. This is not likely to be very robust, // but it should do for just this test. The main shortcomings are escaping, // and not knowing when to quote the variables. // Note we do the replacement backwards (meaning forward_only iterators won't // do!) to avoid substituting e.g. "$12" as "$1" first. template std::string subst( transaction_base &t, std::string q, ITER patbegin, ITER patend) { ptrdiff_t i = distance(patbegin, patend); for (ITER arg = patend; i > 0; --i) { --arg; const std::string marker = "$" + to_string(i), var = stringize(t, *arg); const std::string::size_type msz = marker.size(); while (q.find(marker) != std::string::npos) q.replace(q.find(marker),msz,var); } return q; } template std::string subst( transaction_base &t, std::string q, const CNTNR &patterns) { return subst(t, q, patterns.begin(), patterns.end()); } #include /// @deprecated To be replaced with the C++11-style exec_prepared. void test_legacy_prepared_statement() { connection conn; work tx{conn}; PQXX_CHECK( not tx.prepared("CountToTen").exists(), "Nonexistent prepared statement thinks it exists."); // Prepare a simple statement. conn.prepare("CountToTen", "SELECT * FROM generate_series(1, 10)"); PQXX_CHECK( tx.prepared("CountToTen").exists(), "Prepared statement thinks it doesn't exist."); // See if a basic prepared statement works just like a regular query. PQXX_CHECK_EQUAL( tx.prepared("CountToTen").exec(), tx.exec("SELECT * FROM generate_series(1, 10)"), "CountToTen"); // Try prepare_now() on an already prepared statement. conn.prepare_now("CountToTen"); // Drop prepared statement. conn.unprepare("CountToTen"); PQXX_CHECK_THROWS_EXCEPTION( conn.prepare_now("CountToTen"), "prepare_now() succeeded on dropped statement."); // It's okay to unprepare a statement repeatedly. conn.unprepare("CountToTen"); conn.unprepare("CountToTen"); // Executing an unprepared statement fails. PQXX_CHECK_THROWS_EXCEPTION( tx.prepared("CountToTen").exec(), "Execute unprepared statement didn't fail."); // Once unprepared, a statement can be prepared and used again. conn.prepare( "CountToTen", "SELECT generate_series FROM generate_series(1, 10)"); conn.prepare_now("CountToTen"); COMPARE_RESULTS("CountToTen_2", tx.prepared("CountToTen").exec(), tx.exec("SELECT * FROM generate_series(1, 10)")); // Double preparation of identical statement should be ignored... conn.prepare( "CountToTen", "SELECT generate_series FROM generate_series(1, 10)"); COMPARE_RESULTS("CountToTen_double", tx.prepared("CountToTen").exec(), tx.exec("SELECT * FROM generate_series(1, 10)")); // ...But a modified definition shouldn't. PQXX_CHECK_THROWS_EXCEPTION( conn.prepare( "CountToTen", "SELECT generate_series FROM generate_series(1, 11)"), "Bad redefinition of statement went unnoticed."); // Test prepared statement with parameter. conn.prepare("CountUpToTen", "SELECT * FROM generate_series($1, 10)"); std::vector args = {2}; COMPARE_RESULTS("CountUpToTen_seq", tx.prepared("CountUpToTen")(args[0]).exec(), tx.exec(subst(tx, "SELECT * FROM generate_series($1, 10)", args))); // Test prepared statement with 2 parameters. conn.prepare( "CountRange", "SELECT * FROM generate_series($1::int, $2::int)"); COMPARE_RESULTS("CountRange_seq", tx.prepared("CountRange")(2)(5).exec(), tx.exec("SELECT * FROM generate_series(2, 5)")); // Test prepared statement with a null parameter. std::vector ptrs = {nullptr, "99"}; COMPARE_RESULTS("CountRange_null1", tx.prepared("CountRange")(ptrs[0])(ptrs[1]).exec(), tx.exec("SELECT * FROM generate_series(NULL, 99)")); // Test prepared statement with a binary parameter. conn.prepare("GimmeBinary", "SELECT $1::bytea"); const binarystring bin_data{std::string{"x \x01 \x02 \xff y"}}; PQXX_CHECK_EQUAL( binarystring(tx.prepared("GimmeBinary")(bin_data).exec()[0][0]).str(), bin_data.str(), "Binary parameter was mangled somewhere along the way."); const binarystring nully("x\0y", 3); PQXX_CHECK_EQUAL( binarystring(tx.prepared("GimmeBinary")(nully).exec()[0][0]).str(), nully.str(), "Binary string breaks on nul byte."); // Test unnamed prepared statement. conn.prepare("SELECT 2*$1"); int outcome = tx.prepared()(9).exec()[0][0].as(); PQXX_CHECK_EQUAL(outcome, 18, "Unnamed prepared statement went mad."); // Redefine unnamed prepared statement. Does not need to be unprepared // first. conn.prepare("SELECT 2*$1 + $2"); outcome = tx.prepared()(9)(2).exec()[0][0].as(); PQXX_CHECK_EQUAL(outcome, 20, "Unnamed statement not properly redefined."); // Unlike how the unnamed prepared statement works in libpq, we can issue // other queries and then re-use the unnamed prepared statement. tx.exec("SELECT 12"); outcome = tx.prepared()(3)(1).exec()[0][0].as(); PQXX_CHECK_EQUAL(outcome, 7, "Unnamed statement isn't what it was."); } void test_registration_and_invocation(transaction_base &T) { constexpr auto count_to_5 = "SELECT * FROM generate_series(1, 5)"; PQXX_CHECK( not T.prepared("CountToFive").exists(), "Nonexistent prepared statement thinks it exists."); // Prepare a simple statement. T.conn().prepare("CountToFive", count_to_5); PQXX_CHECK( T.prepared("CountToFive").exists(), "Prepared statement thinks it doesn't exist."); // The statement returns exactly what you'd expect. COMPARE_RESULTS( "CountToFive", T.exec_prepared("CountToFive"), T.exec(count_to_5)); // It's OK to re-prepare the same statement. T.conn().prepare("CountToFive", count_to_5); // Results are still the same. COMPARE_RESULTS( "CountToFive", T.exec_prepared("CountToFive"), T.exec(count_to_5)); // But re-preparing it with a different definition is an error. PQXX_CHECK_THROWS( T.conn().prepare("CountToFive", "SELECT 5"), pqxx::argument_error, "Did not report conflicting re-definition of prepared statement."); // Executing a nonexistent prepared statement is also an error. PQXX_CHECK_THROWS( T.exec_prepared("NonexistentStatement"), pqxx::argument_error, "Did not report invocation of nonexistent prepared statement."); } void test_basic_args(transaction_base &T) { T.conn().prepare("EchoNum", "SELECT $1::int"); auto r = T.exec_prepared("EchoNum", 7); PQXX_CHECK_EQUAL(r.size(), 1u, "Did not get 1 row from prepared statement."); PQXX_CHECK_EQUAL(r.front().size(), 1u, "Did not get exactly one column."); PQXX_CHECK_EQUAL(r[0][0].as(), 7, "Got wrong result."); auto rw = T.exec_prepared1("EchoNum", 8); PQXX_CHECK_EQUAL(rw.size(), 1u, "Did not get 1 column from exec_prepared1."); PQXX_CHECK_EQUAL(rw[0].as(), 8, "Got wrong result."); } void test_multiple_params(transaction_base &T) { T.conn().prepare( "CountSeries", "SELECT * FROM generate_series($1::int, $2::int)"); auto r = T.exec_prepared_n(4, "CountSeries", 7, 10); PQXX_CHECK_EQUAL(r.size(), 4u, "Wrong number of rows, but no error raised."); PQXX_CHECK_EQUAL(r.front().front().as(), 7, "Wrong $1."); PQXX_CHECK_EQUAL(r.back().front().as(), 10, "Wrong $2."); T.conn().prepare( "Reversed", "SELECT * FROM generate_series($2::int, $1::int)"); r = T.exec_prepared_n(3, "Reversed", 8, 6); PQXX_CHECK_EQUAL( r.front().front().as(), 6, "Did parameters get reordered?"); PQXX_CHECK_EQUAL( r.back().front().as(), 8, "$2 did not come through properly."); } void test_nulls(transaction_base &T) { T.conn().prepare("EchoStr", "SELECT $1::varchar"); auto rw = T.exec_prepared1("EchoStr", nullptr); PQXX_CHECK(rw.front().is_null(), "nullptr did not translate to null."); const char *n = nullptr; rw = T.exec_prepared1("EchoStr", n); PQXX_CHECK(rw.front().is_null(), "Null pointer did not translate to null."); } void test_strings(transaction_base &T) { T.conn().prepare("EchoStr", "SELECT $1::varchar"); auto rw = T.exec_prepared1("EchoStr", "foo"); PQXX_CHECK_EQUAL(rw.front().as(), "foo", "Wrong string result."); const char nasty_string[] = "'\\\"\\"; rw = T.exec_prepared1("EchoStr", nasty_string); PQXX_CHECK_EQUAL( rw.front().as(), std::string(nasty_string), "Prepared statement did not quote/escape correctly."); rw = T.exec_prepared1("EchoStr", std::string{nasty_string}); PQXX_CHECK_EQUAL( rw.front().as(), std::string(nasty_string), "Quoting/escaping went wrong in std::string."); char nonconst[] = "non-const C string"; rw = T.exec_prepared1("EchoStr", nonconst); PQXX_CHECK_EQUAL( rw.front().as(), std::string(nonconst), "Non-const C string passed incorrectly."); } void test_binary(transaction_base &T) { T.conn().prepare("EchoBin", "SELECT $1::bytea"); const char raw_bytes[] = "Binary\0bytes'\"with\tweird\xff bytes"; const std::string input{raw_bytes, sizeof(raw_bytes)}; const binarystring bin{input}; auto rw = T.exec_prepared1("EchoBin", bin); PQXX_CHECK_EQUAL( binarystring(rw.front()).str(), input, "Binary string came out damaged."); } void test_dynamic_params(transaction_base &T) { T.conn().prepare("Concat2Numbers", "SELECT 10 * $1 + $2"); const std::vector values{3, 9}; const auto params = prepare::make_dynamic_params(values); const auto rw39 = T.exec_prepared1("Concat2Numbers", params); PQXX_CHECK_EQUAL( rw39.front().as(), 39, "Dynamic prepared-statement parameters went wrong."); T.conn().prepare("Concat4Numbers", "SELECT 1000*$1 + 100*$2 + 10*$3 + $4"); const auto rw1396 = T.exec_prepared1("Concat4Numbers", 1, params, 6); PQXX_CHECK_EQUAL( rw1396.front().as(), 1396, "Dynamic params did not interleave with static ones properly."); } /// Test against any optional type, such as std::optional or /// std::experimental::optional. template void test_optional(transaction_base &T) { T.conn().prepare("EchoNum", "SELECT $1::int"); pqxx::row rw = T.exec_prepared1( "EchoNum", pqxx::internal::make_optional(10) ); PQXX_CHECK_EQUAL( rw.front().as(), 10, "optional (with value) did not return the right value."); rw = T.exec_prepared1("EchoNum", Opt()); PQXX_CHECK( rw.front().is_null(), "optional without value did not come out as null."); } void test_prepared_statements() { connection conn; work tx{conn}; test_registration_and_invocation(tx); test_basic_args(tx); test_multiple_params(tx); test_nulls(tx); test_strings(tx); test_binary(tx); test_dynamic_params(tx); #if defined(PQXX_HAVE_OPTIONAL) test_optional>(tx); #elif defined(PQXX_HAVE_EXP_OPTIONAL) && !defined(PQXX_HIDE_EXP_OPTIONAL) test_optional>(tx); #endif test_optional>(tx); test_optional>(tx); } #include void test_prepared_statement() { test_legacy_prepared_statement(); test_prepared_statements(); } PQXX_REGISTER_TEST(test_prepared_statement); } // namespace libpqxx-6.4.5/test/unit/test_read_transaction.cxx000066400000000000000000000006731350065432700222710ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_read_transaction() { connection conn; read_transaction tx{conn}; PQXX_CHECK_EQUAL( tx.exec("SELECT 1")[0][0].as(), 1, "Bad result from read transaction."); PQXX_CHECK_THROWS( tx.exec("CREATE TABLE should_not_exist(x integer)"), sql_error, "Read-only transaction allows database to be modified."); } PQXX_REGISTER_TEST(test_read_transaction); } libpqxx-6.4.5/test/unit/test_result_iteration.cxx000066400000000000000000000013341350065432700223400ustar00rootroot00000000000000#include "../test_helpers.hxx" namespace { void test_result_iteration() { pqxx::connection conn; pqxx::work tx{conn}; pqxx::result r = tx.exec("SELECT generate_series(1, 3)"); PQXX_CHECK(r.end() != r.begin(), "Broken begin/end."); PQXX_CHECK(r.rend() != r.rbegin(), "Broken rbegin/rend."); PQXX_CHECK(r.cbegin() == r.begin(), "Wrong cbegin."); PQXX_CHECK(r.cend() == r.end(), "Wrong cend."); PQXX_CHECK(r.crbegin() == r.rbegin(), "Wrong crbegin."); PQXX_CHECK(r.crend() == r.rend(), "Wrong crend."); PQXX_CHECK_EQUAL(r.front().front().as(), 1, "Unexpected front()."); PQXX_CHECK_EQUAL(r.back().front().as(), 3, "Unexpected back()."); } PQXX_REGISTER_TEST(test_result_iteration); } // namespace libpqxx-6.4.5/test/unit/test_result_slicing.cxx000066400000000000000000000076411350065432700220010ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace pqxx { template<> struct PQXX_PRIVATE string_traits { static const char *name() { return "row::const_iterator"; } static bool has_null() { return false; } static bool is_null(row::const_iterator) { return false; } static std::string to_string(row::const_iterator) { return "[row::const_iterator]"; } }; template<> struct PQXX_PRIVATE string_traits { static const char *name() { return "row::const_reverse_iterator"; } static bool has_null() { return false; } static bool is_null(row::const_reverse_iterator) { return false; } static std::string to_string(row::const_reverse_iterator) { return "[row::const_reverse_iterator]"; } }; } namespace { void test_result_slicing() { connection conn; work tx{conn}; result r = tx.exec("SELECT 1"); PQXX_CHECK(not r[0].empty(), "A plain row shows up as empty."); // Empty slice at beginning of row. pqxx::row s = r[0].slice(0, 0); PQXX_CHECK(s.empty(), "Empty slice does not show up as empty."); PQXX_CHECK_EQUAL(s.size(), 0u, "Slicing produces wrong row size."); PQXX_CHECK_EQUAL(s.begin(), s.end(), "Slice begin()/end() are broken."); PQXX_CHECK_EQUAL(s.rbegin(), s.rend(), "Slice rbegin()/rend() are broken."); PQXX_CHECK_THROWS(s.at(0), pqxx::range_error, "at() does not throw."); PQXX_CHECK_THROWS(r[0].slice(0, 2), pqxx::range_error, "No range check."); PQXX_CHECK_THROWS(r[0].slice(1, 0), pqxx::range_error, "Can reverse-slice."); // Empty slice at end of row. s = r[0].slice(1, 1); PQXX_CHECK(s.empty(), "empty() is broken."); PQXX_CHECK_EQUAL(s.size(), 0u, "size() is broken."); PQXX_CHECK_EQUAL(s.begin(), s.end(), "begin()/end() are broken."); PQXX_CHECK_EQUAL(s.rbegin(), s.rend(), "rbegin()/rend() are broken."); PQXX_CHECK_THROWS(s.at(0), pqxx::range_error, "at() is inconsistent."); // Slice that matches the entire row. s = r[0].slice(0, 1); PQXX_CHECK(not s.empty(), "Nonempty slice shows up as empty."); PQXX_CHECK_EQUAL(s.size(), 1u, "size() breaks for non-empty slice."); PQXX_CHECK_EQUAL(s.begin() + 1, s.end(), "Iteration is broken."); PQXX_CHECK_EQUAL(s.rbegin() + 1, s.rend(), "Reverse iteration is broken."); PQXX_CHECK_EQUAL(s.at(0).as(), 1, "Accessing a slice is broken."); PQXX_CHECK_EQUAL(s[0].as(), 1, "operator[] is broken."); PQXX_CHECK_THROWS(s.at(1).as(), pqxx::range_error, "at() is off."); // Meaningful slice at beginning of row. r = tx.exec("SELECT 1, 2, 3"); s = r[0].slice(0, 1); PQXX_CHECK(not s.empty(), "Slicing confuses empty()."); PQXX_CHECK_THROWS( s.at(1).as(), pqxx::range_error, "at() does not enforce slice."); // Meaningful slice that skips an initial column. s = r[0].slice(1, 2); PQXX_CHECK(not s.empty(), "Slicing away leading columns confuses empty()."); PQXX_CHECK_EQUAL(s[0].as(), 2, "Slicing offset is broken."); PQXX_CHECK_EQUAL(s.begin()->as(), 2, "Iteration uses wrong offset."); PQXX_CHECK_EQUAL(s.begin() + 1, s.end(), "Iteration has wrong range."); PQXX_CHECK_EQUAL( s.rbegin() + 1, s.rend(), "Reverse iteration has wrong range."); PQXX_CHECK_THROWS( s.at(1).as(), pqxx::range_error, "Offset slicing is broken."); // Column names in a slice. r = tx.exec("SELECT 1 AS one, 2 AS two, 3 AS three"); s = r[0].slice(1, 2); PQXX_CHECK_EQUAL(s["two"].as(), 2, "Column addressing breaks."); PQXX_CHECK_THROWS( s.column_number("one"), argument_error, "Can access column name before slice."); PQXX_CHECK_THROWS( s.column_number("three"), argument_error, "Can access column name after slice."); PQXX_CHECK_EQUAL( s.column_number("Two"), 0u, "Column name is case sensitive."); // Identical column names. r = tx.exec("SELECT 1 AS x, 2 AS x"); s = r[0].slice(1, 2); PQXX_CHECK_EQUAL(s["x"].as(), 2, "Identical column names break slice."); } PQXX_REGISTER_TEST(test_result_slicing); } // namespace libpqxx-6.4.5/test/unit/test_row.cxx000066400000000000000000000016161350065432700175560ustar00rootroot00000000000000#include "../test_helpers.hxx" namespace { void test_row() { pqxx::connection conn; pqxx::work tx{conn}; pqxx::result rows = tx.exec("SELECT 1, 2, 3"); pqxx::row r = rows[0]; PQXX_CHECK_EQUAL(r.size(), 3u, "Unexpected row size."); PQXX_CHECK_EQUAL(r.at(0).as(), 1, "Wrong value at index 0."); PQXX_CHECK(r.begin() != r.end(), "Broken row iteration."); PQXX_CHECK(r.begin() < r.end(), "Row begin does not precede end."); PQXX_CHECK(r.cbegin() == r.begin(), "Wrong cbegin."); PQXX_CHECK(r.cend() == r.end(), "Wrong cend."); PQXX_CHECK(r.rbegin() != r.rend(), "Broken reverse row iteration."); PQXX_CHECK(r.crbegin() == r.rbegin(), "Wrong crbegin."); PQXX_CHECK(r.crend() == r.rend(), "Wrong crend."); PQXX_CHECK_EQUAL(r.front().as(), 1, "Wrong row front()."); PQXX_CHECK_EQUAL(r.back().as(), 3, "Wrong row back()."); } PQXX_REGISTER_TEST(test_row); } // namespace libpqxx-6.4.5/test/unit/test_simultaneous_transactions.cxx000066400000000000000000000005261350065432700242660ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_simultaneous_transactions() { connection conn; nontransaction n1{conn}; PQXX_CHECK_THROWS( nontransaction n2{conn}, std::logic_error, "Allowed to open simultaneous nontransactions."); } PQXX_REGISTER_TEST(test_simultaneous_transactions); } // namespace libpqxx-6.4.5/test/unit/test_sql_cursor.cxx000066400000000000000000000252671350065432700211530ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_forward_sql_cursor() { connection conn; work tx{conn}; // Plain owned, scoped, forward-only read-only cursor. internal::sql_cursor forward( tx, "SELECT generate_series(1, 4)", "forward", cursor_base::forward_only, cursor_base::read_only, cursor_base::owned, false); PQXX_CHECK_EQUAL(forward.pos(), 0, "Wrong initial position"); PQXX_CHECK_EQUAL(forward.endpos(), -1, "Wrong initial endpos()"); result empty_result = forward.empty_result(); PQXX_CHECK_EQUAL(empty_result.size(), 0u, "Empty result not empty"); cursor_base::difference_type displacement = 0; result one = forward.fetch(1, displacement); PQXX_CHECK_EQUAL(one.size(), 1u, "Fetched wrong number of rows"); PQXX_CHECK_EQUAL(one[0][0].as(), "1", "Unexpected result"); PQXX_CHECK_EQUAL(displacement, 1, "Wrong displacement"); PQXX_CHECK_EQUAL(forward.pos(), 1, "In wrong position"); cursor_base::difference_type offset = forward.move(1, displacement); PQXX_CHECK_EQUAL(offset, 1, "Unexpected offset from move()"); PQXX_CHECK_EQUAL(displacement, 1, "Unexpected displacement after move()"); PQXX_CHECK_EQUAL(forward.pos(), 2, "Wrong position after move()"); PQXX_CHECK_EQUAL(forward.endpos(), -1, "endpos() unexpectedly set"); result row = forward.fetch(0, displacement); PQXX_CHECK_EQUAL(row.size(), 0u, "fetch(0, displacement) returns rows"); PQXX_CHECK_EQUAL(displacement, 0, "Unexpected displacement after fetch(0)"); PQXX_CHECK_EQUAL(forward.pos(), 2, "fetch(0, displacement) affected pos()"); row = forward.fetch(0); PQXX_CHECK_EQUAL(row.size(), 0u, "fetch(0) fetched wrong number of rows"); PQXX_CHECK_EQUAL(forward.pos(), 2, "fetch(0) moved cursor"); PQXX_CHECK_EQUAL(forward.pos(), 2, "fetch(0) affected pos()"); offset = forward.move(1); PQXX_CHECK_EQUAL(offset, 1, "move(1) returned unexpected value"); PQXX_CHECK_EQUAL(forward.pos(), 3, "move(1) after fetch(0) broke"); row = forward.fetch(1); PQXX_CHECK_EQUAL(row.size(), 1u, "fetch(1) returned wrong number of rows"); PQXX_CHECK_EQUAL(forward.pos(), 4, "fetch(1) results in bad pos()"); PQXX_CHECK_EQUAL(row[0][0].as(), "4", "pos() is lying"); empty_result = forward.fetch(1, displacement); PQXX_CHECK_EQUAL(empty_result.size(), 0u, "Got rows at end of cursor"); PQXX_CHECK_EQUAL(forward.pos(), 5, "Not at one-past-end position"); PQXX_CHECK_EQUAL(forward.endpos(), 5, "Failed to notice end position"); PQXX_CHECK_EQUAL(displacement, 1, "Wrong displacement at end position"); offset = forward.move(5, displacement); PQXX_CHECK_EQUAL(offset, 0, "move() lied at end of result set"); PQXX_CHECK_EQUAL(forward.pos(), 5, "pos() is beyond end"); PQXX_CHECK_EQUAL(forward.endpos(), 5, "endpos() changed after end position"); PQXX_CHECK_EQUAL(displacement, 0, "Wrong displacement after end position"); // Move through entire result set at once. internal::sql_cursor forward2( tx, "SELECT generate_series(1, 4)", "forward", cursor_base::forward_only, cursor_base::read_only, cursor_base::owned, false); // Move through entire result set at once. offset = forward2.move(cursor_base::all(), displacement); PQXX_CHECK_EQUAL(offset, 4, "Unexpected number of rows in result set"); PQXX_CHECK_EQUAL(displacement, 5, "displacement != rows+1"); PQXX_CHECK_EQUAL(forward2.pos(), 5, "Bad pos() after skipping all rows"); PQXX_CHECK_EQUAL(forward2.endpos(), 5, "Bad endpos() after skipping"); internal::sql_cursor forward3( tx, "SELECT generate_series(1, 4)", "forward", cursor_base::forward_only, cursor_base::read_only, cursor_base::owned, false); // Fetch entire result set at once. result rows = forward3.fetch(cursor_base::all(), displacement); PQXX_CHECK_EQUAL(rows.size(), 4u, "Unexpected number of rows in result set"); PQXX_CHECK_EQUAL(displacement, 5, "displacement != rows+1"); PQXX_CHECK_EQUAL(forward3.pos(), 5, "Bad pos() after fetching all rows"); PQXX_CHECK_EQUAL(forward3.endpos(), 5, "Bad endpos() after fetching"); internal::sql_cursor forward_empty( tx, "SELECT generate_series(0, -1)", "forward_empty", cursor_base::forward_only, cursor_base::read_only, cursor_base::owned, false); offset = forward_empty.move(3, displacement); PQXX_CHECK_EQUAL(forward_empty.pos(), 1, "Bad pos() at end of result"); PQXX_CHECK_EQUAL(forward_empty.endpos(), 1, "Bad endpos() in empty result"); PQXX_CHECK_EQUAL(displacement, 1, "Bad displacement in empty result"); PQXX_CHECK_EQUAL(offset, 0, "move() in empty result counted rows"); } void test_scroll_sql_cursor() { connection conn; work tx{conn}; internal::sql_cursor scroll( tx, "SELECT generate_series(1, 10)", "scroll", cursor_base::random_access, cursor_base::read_only, cursor_base::owned, false); PQXX_CHECK_EQUAL(scroll.pos(), 0, "Scroll cursor's initial pos() is wrong"); PQXX_CHECK_EQUAL(scroll.endpos(), -1, "New scroll cursor has endpos() set"); result rows = scroll.fetch(cursor_base::next()); PQXX_CHECK_EQUAL(rows.size(), 1u, "Scroll cursor is broken"); PQXX_CHECK_EQUAL(scroll.pos(), 1, "Scroll cursor's pos() is broken"); PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set prematurely"); // Turn cursor around. This is where we begin to feel SQL cursors' semantics: // we pre-decrement, ending up on the position in front of the first row and // returning no rows. rows = scroll.fetch(cursor_base::prior()); PQXX_CHECK_EQUAL(rows.empty(), true, "Turning around on fetch() broke"); PQXX_CHECK_EQUAL(scroll.pos(), 0, "pos() is not back at zero"); PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set on wrong side of result"); // Bounce off the left-hand side of the result set. Can't move before the // starting position. cursor_base::difference_type offset = 0, displacement = 0; offset = scroll.move(-3, displacement); PQXX_CHECK_EQUAL(offset, 0, "Rows found before beginning"); PQXX_CHECK_EQUAL(displacement, 0, "Failed to bounce off beginning"); PQXX_CHECK_EQUAL(scroll.pos(), 0, "pos() moved back from zero"); PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set on left-side bounce"); // Try bouncing off the left-hand side a little harder. Take 4 paces away // from the boundary and run into it. offset = scroll.move(4, displacement); PQXX_CHECK_EQUAL(offset, 4, "Offset mismatch"); PQXX_CHECK_EQUAL(displacement, 4, "Displacement mismatch"); PQXX_CHECK_EQUAL(scroll.pos(), 4, "Position mismatch"); PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set at weird time"); offset = scroll.move(-10, displacement); PQXX_CHECK_EQUAL(offset, 3, "Offset mismatch"); PQXX_CHECK_EQUAL(displacement, -4, "Displacement mismatch"); PQXX_CHECK_EQUAL(scroll.pos(), 0, "Hard bounce failed"); PQXX_CHECK_EQUAL(scroll.endpos(), -1, "endpos() set during hard bounce"); rows = scroll.fetch(3); PQXX_CHECK_EQUAL(scroll.pos(), 3, "Bad pos()"); PQXX_CHECK_EQUAL(rows.size(), 3u, "Wrong number of rows"); PQXX_CHECK_EQUAL(rows[2][0].as(), 3, "pos() does not match data"); rows = scroll.fetch(-1); PQXX_CHECK_EQUAL(scroll.pos(), 2, "Bad pos()"); PQXX_CHECK_EQUAL(rows[0][0].as(), 2, "pos() does not match data"); rows = scroll.fetch(1); PQXX_CHECK_EQUAL(scroll.pos(), 3, "Bad pos() after inverse turnaround"); PQXX_CHECK_EQUAL(rows[0][0].as(), 3, "Data position mismatch"); } void test_adopted_sql_cursor() { connection conn; work tx{conn}; tx.exec( "DECLARE adopted SCROLL CURSOR FOR " "SELECT generate_series(1, 3)"); internal::sql_cursor adopted(tx, "adopted", cursor_base::owned); PQXX_CHECK_EQUAL(adopted.pos(), -1, "Adopted cursor has known pos()"); PQXX_CHECK_EQUAL(adopted.endpos(), -1, "Adopted cursor has known endpos()"); cursor_base::difference_type displacement = 0; result rows = adopted.fetch(cursor_base::all(), displacement); PQXX_CHECK_EQUAL(rows.size(), 3u, "Wrong number of rows in result"); PQXX_CHECK_EQUAL(rows[0][0].as(), 1, "Wrong result data"); PQXX_CHECK_EQUAL(rows[2][0].as(), 3, "Wrong result data"); PQXX_CHECK_EQUAL(displacement, 4, "Wrong displacement"); PQXX_CHECK_EQUAL(adopted.pos(), -1, "End-of-result set pos() on adopted cur"); PQXX_CHECK_EQUAL(adopted.endpos(), -1, "endpos() set too early"); rows = adopted.fetch(cursor_base::backward_all(), displacement); PQXX_CHECK_EQUAL(rows.size(), 3u, "Wrong number of rows in result"); PQXX_CHECK_EQUAL(rows[0][0].as(), 3, "Wrong result data"); PQXX_CHECK_EQUAL(rows[2][0].as(), 1, "Wrong result data"); PQXX_CHECK_EQUAL(displacement, -4, "Wrong displacement"); PQXX_CHECK_EQUAL(adopted.pos(), 0, "Failed to recognize starting position"); PQXX_CHECK_EQUAL(adopted.endpos(), -1, "endpos() set too early"); cursor_base::difference_type offset = adopted.move(cursor_base::all()); PQXX_CHECK_EQUAL(offset, 3, "Unexpected move() offset"); PQXX_CHECK_EQUAL(adopted.pos(), 4, "Bad position on adopted cursor"); PQXX_CHECK_EQUAL(adopted.endpos(), 4, "endpos() not set properly"); // Owned adopted cursors are cleaned up on destruction. connection conn2; work tx2(conn2, "tx2"); tx2.exec( "DECLARE adopted2 CURSOR FOR " "SELECT generate_series(1, 3)"); { internal::sql_cursor(tx2, "adopted2", cursor_base::owned); } if (conn2.server_version() >= 80000) { // Modern backends: accessing the cursor now is an error, as you'd expect. PQXX_CHECK_THROWS( tx2.exec("FETCH 1 IN adopted2"), sql_error, "Owned adopted cursor not cleaned up"); } else { // Old backends: see that we can at least create a new cursor with the same // name. tx2.exec("DECLARE adopted2 CURSOR FOR SELECT TRUE"); } tx2.abort(); work tx3(conn2, "tx3"); tx3.exec( "DECLARE adopted3 CURSOR FOR " "SELECT generate_series(1, 3)"); { internal::sql_cursor(tx3, "adopted3", cursor_base::loose); } tx3.exec("MOVE 1 IN adopted3"); } void test_hold_cursor() { connection conn; work tx{conn}; // "With hold" cursor is kept after commit. internal::sql_cursor with_hold( tx, "SELECT generate_series(1, 3)", "hold_cursor", cursor_base::forward_only, cursor_base::read_only, cursor_base::owned, true); tx.commit(); work tx2(conn, "tx2"); result rows = with_hold.fetch(1); PQXX_CHECK_EQUAL(rows.size(), 1u, "Did not get 1 row from with-hold cursor"); // Cursor without hold is closed on commit. internal::sql_cursor no_hold( tx2, "SELECT generate_series(1, 3)", "no_hold_cursor", cursor_base::forward_only, cursor_base::read_only, cursor_base::owned, false); tx2.commit(); work tx3(conn, "tx3"); PQXX_CHECK_THROWS(no_hold.fetch(1), sql_error, "Cursor not closed on commit"); } void cursor_tests() { test_forward_sql_cursor(); test_scroll_sql_cursor(); test_adopted_sql_cursor(); test_hold_cursor(); } PQXX_REGISTER_TEST(cursor_tests); } // namespace libpqxx-6.4.5/test/unit/test_stateless_cursor.cxx000066400000000000000000000057741350065432700223640ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_stateless_cursor() { connection conn; work tx{conn}; stateless_cursor empty( tx, "SELECT generate_series(0, -1)", "empty", false); result rows = empty.retrieve(0, 0); PQXX_CHECK_EQUAL(rows.empty(), true, "Empty result not empty"); rows = empty.retrieve(0, 1); PQXX_CHECK_EQUAL(rows.size(), 0u, "Empty result returned rows"); PQXX_CHECK_EQUAL(empty.size(), 0u, "Empty cursor not empty"); PQXX_CHECK_THROWS( empty.retrieve(1, 0), std::out_of_range, "Empty cursor tries to retrieve"); stateless_cursor stateless( tx, "SELECT generate_series(0, 9)", "stateless", false); PQXX_CHECK_EQUAL(stateless.size(), 10u, "stateless_cursor::size() mismatch"); // Retrieve nothing. rows = stateless.retrieve(1, 1); PQXX_CHECK_EQUAL(rows.size(), 0u, "1-to-1 retrieval not empty"); // Retrieve two rows. rows = stateless.retrieve(1, 3); PQXX_CHECK_EQUAL(rows.size(), 2u, "Retrieved wrong number of rows"); PQXX_CHECK_EQUAL(rows[0][0].as(), 1, "Data/position mismatch"); PQXX_CHECK_EQUAL(rows[1][0].as(), 2, "Data/position mismatch"); // Retrieve same rows in reverse. rows = stateless.retrieve(2, 0); PQXX_CHECK_EQUAL(rows.size(), 2u, "Retrieved wrong number of rows"); PQXX_CHECK_EQUAL(rows[0][0].as(), 2, "Data/position mismatch"); PQXX_CHECK_EQUAL(rows[1][0].as(), 1, "Data/position mismatch"); // Retrieve beyond end. rows = stateless.retrieve(9, 13); PQXX_CHECK_EQUAL(rows.size(), 1u, "Row count wrong at end"); PQXX_CHECK_EQUAL(rows[0][0].as(), 9, "Data/pos mismatch at end"); // Retrieve beyond beginning. rows = stateless.retrieve(0, -4); PQXX_CHECK_EQUAL(rows.size(), 1u, "Row count wrong at beginning"); PQXX_CHECK_EQUAL(rows[0][0].as(), 0, "Data/pos mismatch at beginning"); // Retrieve entire result set backwards. rows = stateless.retrieve(10, -15); PQXX_CHECK_EQUAL(rows.size(), 10u, "Reverse complete retrieval is broken"); PQXX_CHECK_EQUAL(rows[0][0].as(), 9, "Data mismatch"); PQXX_CHECK_EQUAL(rows[9][0].as(), 0, "Data mismatch"); // Normal usage pattern: step through result set, 4 rows at a time. rows = stateless.retrieve(0, 4); PQXX_CHECK_EQUAL(rows.size(), 4u, "Wrong batch size"); PQXX_CHECK_EQUAL(rows[0][0].as(), 0, "Batch in wrong place"); PQXX_CHECK_EQUAL(rows[3][0].as(), 3, "Batch in wrong place"); rows = stateless.retrieve(4, 8); PQXX_CHECK_EQUAL(rows.size(), 4u, "Wrong batch size"); PQXX_CHECK_EQUAL(rows[0][0].as(), 4, "Batch in wrong place"); PQXX_CHECK_EQUAL(rows[3][0].as(), 7, "Batch in wrong place"); rows = stateless.retrieve(8, 12); PQXX_CHECK_EQUAL(rows.size(), 2u, "Wrong batch size"); PQXX_CHECK_EQUAL(rows[0][0].as(), 8, "Batch in wrong place"); PQXX_CHECK_EQUAL(rows[1][0].as(), 9, "Batch in wrong place"); } PQXX_REGISTER_TEST(test_stateless_cursor); } // namespace libpqxx-6.4.5/test/unit/test_stream_from.cxx000066400000000000000000000163771350065432700212770ustar00rootroot00000000000000#include "../test_helpers.hxx" #include "test_types.hxx" #include #include #include #include #include #include #if defined PQXX_HAVE_OPTIONAL #include #elif defined PQXX_HAVE_EXP_OPTIONAL && !defined(PQXX_HIDE_EXP_OPTIONAL) #include #endif namespace { void test_nonoptionals(pqxx::connection_base& connection) { pqxx::work transaction{connection}; pqxx::stream_from extractor{transaction, "stream_from_test"}; PQXX_CHECK(extractor, "stream_from failed to initialize"); std::tuple< int, std::string, int, ipv4, std::string, bytea > got_tuple; extractor >> got_tuple; PQXX_CHECK(extractor, "stream_from failed to read first row"); PQXX_CHECK_EQUAL(std::get<0>(got_tuple), 1234, "field value mismatch"); // PQXX_CHECK_EQUAL(*std::get<1>(got_tuple), , "field value mismatch"); PQXX_CHECK_EQUAL(std::get<2>(got_tuple), 4321, "field value mismatch"); PQXX_CHECK_EQUAL( std::get<3>(got_tuple), (ipv4{8, 8, 8, 8}), "field value mismatch"); PQXX_CHECK_EQUAL( std::get<4>(got_tuple), "hello world", "field value mismatch"); PQXX_CHECK_EQUAL( std::get<5>(got_tuple), (bytea{'\x00', '\x01', '\x02'}), "field value mismatch"); try { extractor >> got_tuple; PQXX_CHECK_NOTREACHED("stream_from improperly read second row"); } catch (const pqxx::conversion_error &e) { std::string what{e.what()}; if (what != "Attempt to convert null to int.") throw; pqxx::test::expected_exception("Could not extract row: " + what); } std::tuple< int, std::string, std::nullptr_t, std::nullptr_t, std::string, bytea > got_tuple_nulls1; std::tuple< int, std::nullptr_t, std::nullptr_t, std::nullptr_t, std::string, bytea > got_tuple_nulls2; try { extractor >> got_tuple_nulls2; PQXX_CHECK_NOTREACHED("stream_from improperly read second row"); } catch (const pqxx::conversion_error &e) { if (std::string{e.what(), 27} != "Attempt to convert non-null") throw; pqxx::test::expected_exception( std::string{"Could not extract row: "} + e.what() ); } extractor >> got_tuple_nulls1; PQXX_CHECK(extractor, "stream_from failed to reentrantly read second row"); extractor >> got_tuple_nulls2; PQXX_CHECK(extractor, "stream_from failed to reentrantly read third row"); extractor >> got_tuple; PQXX_CHECK(not extractor, "stream_from failed to detect end of stream"); extractor.complete(); } void test_bad_tuples(pqxx::connection_base &conn) { pqxx::work tx{conn}; pqxx::stream_from extractor{tx, "stream_from_test"}; PQXX_CHECK(extractor, "stream_from failed to initialize"); std::tuple got_tuple_too_short; try { extractor >> got_tuple_too_short; PQXX_CHECK_NOTREACHED("stream_from improperly read first row"); } catch (const pqxx::usage_error &e) { std::string what{e.what()}; if (what != "Not all fields extracted from stream_from line") throw; pqxx::test::expected_exception("Could not extract row: " + what); } std::tuple< int, std::string, int, ipv4, std::string, bytea, std::string > got_tuple_too_long; try { extractor >> got_tuple_too_long; PQXX_CHECK_NOTREACHED("stream_from improperly read first row"); } catch (const pqxx::usage_error &e) { std::string what{e.what()}; if (what != "Too few fields to extract from stream_from line.") throw; pqxx::test::expected_exception("Could not extract row: " + what); } extractor.complete(); } #define ASSERT_FIELD_EQUAL(OPT, VAL) \ PQXX_CHECK(static_cast(OPT), "unexpected null field"); \ PQXX_CHECK_EQUAL(*OPT, VAL, "field value mismatch") #define ASSERT_FIELD_NULL(OPT) \ PQXX_CHECK(not static_cast(OPT), "expected null field") template class O> void test_optional(pqxx::connection_base& connection) { pqxx::work transaction{connection}; pqxx::stream_from extractor{transaction, "stream_from_test"}; PQXX_CHECK(extractor, "stream_from failed to initialize"); std::tuple< int, O, O, O, O, O > got_tuple; extractor >> got_tuple; PQXX_CHECK(extractor, "stream_from failed to read first row"); PQXX_CHECK_EQUAL(std::get<0>(got_tuple), 1234, "field value mismatch"); PQXX_CHECK(static_cast(std::get<1>(got_tuple)), "unexpected null field"); // PQXX_CHECK_EQUAL(*std::get<1>(got_tuple), , "field value mismatch"); ASSERT_FIELD_EQUAL(std::get<2>(got_tuple), 4321); ASSERT_FIELD_EQUAL(std::get<3>(got_tuple), (ipv4{8, 8, 8, 8})); ASSERT_FIELD_EQUAL(std::get<4>(got_tuple), "hello world"); ASSERT_FIELD_EQUAL(std::get<5>(got_tuple), (bytea{'\x00', '\x01', '\x02'})); extractor >> got_tuple; PQXX_CHECK(extractor, "stream_from failed to read second row"); PQXX_CHECK_EQUAL(std::get<0>(got_tuple), 5678, "field value mismatch"); ASSERT_FIELD_EQUAL(std::get<1>(got_tuple), "2018-11-17 21:23:00"); ASSERT_FIELD_NULL(std::get<2>(got_tuple)); ASSERT_FIELD_NULL(std::get<3>(got_tuple)); ASSERT_FIELD_EQUAL(std::get<4>(got_tuple), "こんにちは"); ASSERT_FIELD_EQUAL(std::get<5>(got_tuple), (bytea{'f', 'o', 'o', ' ', 'b', 'a', 'r', '\0'})); extractor >> got_tuple; PQXX_CHECK(extractor, "stream_from failed to read third row"); PQXX_CHECK_EQUAL(std::get<0>(got_tuple), 910, "field value mismatch"); ASSERT_FIELD_NULL(std::get<1>(got_tuple)); ASSERT_FIELD_NULL(std::get<2>(got_tuple)); ASSERT_FIELD_NULL(std::get<3>(got_tuple)); ASSERT_FIELD_EQUAL(std::get<4>(got_tuple), "\\N"); ASSERT_FIELD_EQUAL(std::get<5>(got_tuple), bytea{}); extractor >> got_tuple; PQXX_CHECK(not extractor, "stream_from failed to detect end of stream"); extractor.complete(); } void test_stream_from() { pqxx::connection conn; pqxx::work tx{conn}; tx.exec( "CREATE TEMP TABLE stream_from_test (" "number0 INT NOT NULL," "ts1 TIMESTAMP NULL," "number2 INT NULL," "addr3 INET NULL," "txt4 TEXT NULL," "bin5 BYTEA NOT NULL" ")" ); tx.exec_params( "INSERT INTO stream_from_test VALUES ($1,$2,$3,$4,$5,$6)", 1234, "now", 4321, ipv4{8, 8, 8, 8}, "hello world", bytea{'\x00', '\x01', '\x02'} ); tx.exec_params( "INSERT INTO stream_from_test VALUES ($1,$2,$3,$4,$5,$6)", 5678, "2018-11-17 21:23:00", nullptr, nullptr, "こんにちは", bytea{'f', 'o', 'o', ' ', 'b', 'a', 'r', '\0'} ); tx.exec_params( "INSERT INTO stream_from_test VALUES ($1,$2,$3,$4,$5,$6)", 910, nullptr, nullptr, nullptr, "\\N", bytea{} ); tx.commit(); test_nonoptionals(conn); test_bad_tuples(conn); std::cout << "testing `std::unique_ptr` as optional...\n"; test_optional(conn); std::cout << "testing `custom_optional` as optional...\n"; test_optional(conn); #if defined PQXX_HAVE_OPTIONAL std::cout << "testing `std::optional` as optional...\n"; test_optional(conn); #elif defined PQXX_HAVE_EXP_OPTIONAL && !defined(PQXX_HIDE_EXP_OPTIONAL) std::cout << "testing `std::experimental::optional` as optional...\n"; test_optional(conn); #endif } PQXX_REGISTER_TEST(test_stream_from); } // namespace libpqxx-6.4.5/test/unit/test_stream_to.cxx000066400000000000000000000115451350065432700207460ustar00rootroot00000000000000#include "../test_helpers.hxx" #include "test_types.hxx" #include #include #if defined PQXX_HAVE_OPTIONAL #include #elif defined PQXX_HAVE_EXP_OPTIONAL && !defined(PQXX_HIDE_EXP_OPTIONAL) #include #endif namespace { std::string truncate_sql_error(const std::string &what) { auto trunc = what.substr(0, what.find('\n')); if (trunc.size() > 64) trunc = trunc.substr(0, 61) + "..."; return trunc; } void test_nonoptionals(pqxx::connection_base& connection) { pqxx::work transaction{connection}; pqxx::stream_to inserter{transaction, "stream_to_test"}; PQXX_CHECK(inserter, "stream_to failed to initialize"); inserter << std::make_tuple( 1234, "now", 4321, ipv4{8, 8, 8, 8}, "hello world", bytea{'\x00', '\x01', '\x02'} ); inserter << std::make_tuple( 5678, "2018-11-17 21:23:00", nullptr, nullptr, "こんにちは", bytea{'f', 'o', 'o', ' ', 'b', 'a', 'r', '\0'} ); inserter << std::make_tuple( 910, nullptr, nullptr, nullptr, "\\N", bytea{} ); inserter.complete(); transaction.commit(); } void test_bad_null(pqxx::connection_base& connection) { pqxx::work transaction{connection}; pqxx::stream_to inserter{transaction, "stream_to_test"}; PQXX_CHECK(inserter, "stream_to failed to initialize"); try { inserter << std::make_tuple( nullptr, "now", 4321, ipv4{8, 8, 8, 8}, "hello world", bytea{'\x00', '\x01', '\x02'} ); inserter.complete(); transaction.commit(); PQXX_CHECK_NOTREACHED("stream_from improperly inserted row"); } catch (const pqxx::sql_error& e) { std::string what{e.what()}; if (what.find("null value in column") == std::string::npos) throw; pqxx::test::expected_exception( "Could not insert row: " + truncate_sql_error(what) ); } } void test_too_few_fields(pqxx::connection_base& connection) { pqxx::work transaction{connection}; pqxx::stream_to inserter{transaction, "stream_to_test"}; PQXX_CHECK(inserter, "stream_to failed to initialize"); try { inserter << std::make_tuple( 1234, "now", 4321, ipv4{8, 8, 8, 8} ); inserter.complete(); transaction.commit(); PQXX_CHECK_NOTREACHED("stream_from improperly inserted row"); } catch (const pqxx::sql_error& e) { std::string what{e.what()}; if (what.find("missing data for column") == std::string::npos) throw; pqxx::test::expected_exception( "Could not insert row: " + truncate_sql_error(what) ); } } void test_too_many_fields(pqxx::connection_base& connection) { pqxx::work transaction{connection}; pqxx::stream_to inserter{transaction, "stream_to_test"}; PQXX_CHECK(inserter, "stream_to failed to initialize"); try { inserter << std::make_tuple( 1234, "now", 4321, ipv4{8, 8, 8, 8}, "hello world", bytea{'\x00', '\x01', '\x02'}, 5678 ); inserter.complete(); transaction.commit(); PQXX_CHECK_NOTREACHED("stream_from improperly inserted row"); } catch (const pqxx::sql_error& e) { std::string what{e.what()}; if (what.find("extra data") == std::string::npos) throw; pqxx::test::expected_exception( "Could not insert row: " + truncate_sql_error(what) ); } } template class O> void test_optional(pqxx::connection_base& connection) { pqxx::work transaction{connection}; pqxx::stream_to inserter{transaction, "stream_to_test"}; PQXX_CHECK(inserter, "stream_to failed to initialize"); inserter << std::make_tuple( 910, O(pqxx::internal::null_value>()), O(pqxx::internal::null_value>()), O(pqxx::internal::null_value>()), "\\N", bytea{} ); inserter.complete(); transaction.commit(); } void test_stream_to() { pqxx::connection conn; pqxx::work tx{conn}; tx.exec( "CREATE TEMP TABLE stream_to_test (" "number0 INT NOT NULL," "ts1 TIMESTAMP NULL," "number2 INT NULL," "addr3 INET NULL," "txt4 TEXT NULL," "bin5 BYTEA NOT NULL" ")" ); tx.commit(); test_nonoptionals(conn); test_bad_null(conn); test_too_few_fields(conn); test_too_many_fields(conn); std::cout << "testing `std::unique_ptr` as optional...\n"; test_optional(conn); std::cout << "testing `custom_optional` as optional...\n"; test_optional(conn); #if defined PQXX_HAVE_OPTIONAL std::cout << "testing `std::optional` as optional...\n"; test_optional(conn); #elif defined PQXX_HAVE_EXP_OPTIONAL && !defined(PQXX_HIDE_EXP_OPTIONAL) std::cout << "testing `std::experimental::optional` as optional...\n"; test_optional(conn); #endif } PQXX_REGISTER_TEST(test_stream_to); } // namespace libpqxx-6.4.5/test/unit/test_string_conversion.cxx000066400000000000000000000066351350065432700225300ustar00rootroot00000000000000#include #include "../test_helpers.hxx" using namespace pqxx; // Some enums with string conversions. enum EnumA { ea0, ea1, ea2 }; enum EnumB { eb0, eb1, eb2 }; namespace pqxx { PQXX_DECLARE_ENUM_CONVERSION(EnumA); PQXX_DECLARE_ENUM_CONVERSION(EnumB); } namespace { void test_string_conversion() { PQXX_CHECK_EQUAL( "C string array", to_string("C string array"), "C-style string constant does not convert to string properly."); char text_array[] = "C char array"; PQXX_CHECK_EQUAL( "C char array", to_string(text_array), "C-style non-const char array does not convert to string properly."); const char *text_ptr = "C string pointer"; PQXX_CHECK_EQUAL( "C string pointer", to_string(text_ptr), "C-style string pointer does not convert to string properly."); const std::string cxx_string = "C++ string"; PQXX_CHECK_EQUAL( "C++ string", to_string(cxx_string), "C++-style string object does not convert to string properly."); PQXX_CHECK_EQUAL("0", to_string(0), "Zero does not convert right."); PQXX_CHECK_EQUAL("1", to_string(1), "Basic integer does not convert right."); PQXX_CHECK_EQUAL("-1", to_string(-1), "Negative numbers don't work."); PQXX_CHECK_EQUAL("9999", to_string(9999), "Larger numbers don't work."); PQXX_CHECK_EQUAL( "-9999", to_string(-9999), "Larger negative numbers don't work."); int x; from_string("0", x); PQXX_CHECK_EQUAL(0, x, "Zero does not parse right."); from_string("1", x); PQXX_CHECK_EQUAL(1, x, "Basic integer does not parse right."); from_string("-1", x); PQXX_CHECK_EQUAL(-1, x, "Negative numbers don't work."); from_string("9999", x); PQXX_CHECK_EQUAL(9999, x, "Larger numbers don't work."); from_string("-9999", x); PQXX_CHECK_EQUAL(-9999, x, "Larger negative numbers don't work."); // Bug #263 describes a case where this kind of overflow went undetected. if (sizeof(unsigned int) == 4) { std::uint32_t u; PQXX_CHECK_THROWS( from_string("4772185884", u), pqxx::conversion_error, "Overflow not detected."); } // We can convert to and from long double. The implementation may fall // back on a thread-local std::stringstream. Each call does its own // cleanup, so the conversion works multiple times. constexpr long double ld1 = 123456789.25, ld2 = 9876543210.5; constexpr char lds1[] = "123456789.25", lds2[] = "9876543210.5"; PQXX_CHECK_EQUAL( to_string(ld1).substr(0, 12), lds1, "Wrong conversion from long double."); PQXX_CHECK_EQUAL( to_string(ld2).substr(0, 12), lds2, "Wrong value on repeated conversion from long double."); long double ldi1, ldi2; from_string(lds1, ldi1); PQXX_CHECK_BOUNDS( ldi1, ld1 - 0.00001, ld1 + 0.00001, "Wrong conversion to long double."); from_string(lds2, ldi2); PQXX_CHECK_BOUNDS( ldi2, ld2 - 0.00001, ld2 + 0.00001, "Wrong repeated conversion to long double."); // We can define string conversions for enums. PQXX_CHECK_EQUAL( to_string(ea0), "0", "Enum-to-string conversion is broken."); PQXX_CHECK_EQUAL( to_string(eb0), "0", "Enum-to-string conversion is inconsistent between enum types."); PQXX_CHECK_EQUAL( to_string(ea1), "1", "Enum-to-string conversion breaks for nonzero value."); EnumA ea; from_string("2", ea); PQXX_CHECK_EQUAL(ea, ea2, "String-to-enum conversion is broken."); } PQXX_REGISTER_TEST(test_string_conversion); } // namespace libpqxx-6.4.5/test/unit/test_subtransaction.cxx000066400000000000000000000027641350065432700220130ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void make_table(transaction_base &trans) { trans.exec("CREATE TEMP TABLE foo (x INTEGER)"); } void insert_row(transaction_base &trans) { trans.exec("INSERT INTO foo(x) VALUES (1)"); } int count_rows(transaction_base &trans) { const result r = trans.exec("SELECT count(*) FROM foo"); return r[0][0].as(); } void test_subtransaction_commits_if_commit_called(connection_base &conn) { work trans(conn); make_table(trans); { subtransaction sub(trans); insert_row(sub); sub.commit(); } PQXX_CHECK_EQUAL( count_rows(trans), 1, "Work done in committed subtransaction was lost."); } void test_subtransaction_aborts_if_abort_called(connection_base &conn) { work trans(conn); make_table(trans); { subtransaction sub(trans); insert_row(sub); sub.abort(); } PQXX_CHECK_EQUAL( count_rows(trans), 0, "Aborted subtransaction was not rolled back."); } void test_subtransaction_aborts_implicitly(connection_base &conn) { work trans(conn); make_table(trans); { subtransaction sub(trans); insert_row(sub); } PQXX_CHECK_EQUAL( count_rows(trans), 0, "Uncommitted subtransaction was not rolled back uring destruction."); } void test_subtransaction() { connection conn; test_subtransaction_commits_if_commit_called(conn); test_subtransaction_aborts_if_abort_called(conn); test_subtransaction_aborts_implicitly(conn); } PQXX_REGISTER_TEST(test_subtransaction); } // namespace libpqxx-6.4.5/test/unit/test_test_helpers.cxx000066400000000000000000000136761350065432700214610ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; using namespace pqxx::test; namespace { void empty() {} void test_check_notreached() { // At a minimum, PQXX_CHECK_NOTREACHED must work. bool failed = true; try { PQXX_CHECK_NOTREACHED("(expected)"); failed = false; } catch (const test_failure &) { // This is what we expect. } if (not failed) throw test_failure(__FILE__, __LINE__, "PQXX_CHECK_NOTREACHED is broken."); } // Test PQXX_CHECK. void test_check() { PQXX_CHECK(true, "PQXX_CHECK is broken."); bool failed = true; try { PQXX_CHECK(false, "(expected)"); failed = false; } catch (const test_failure &) { } if (not failed) PQXX_CHECK_NOTREACHED("PQXX_CHECK failed to notice failure."); } // Test PQXX_CHECK_THROWS_EXCEPTION. void test_check_throws_exception() { // PQXX_CHECK_THROWS_EXCEPTION expects std::exception... PQXX_CHECK_THROWS_EXCEPTION( throw std::exception(), "PQXX_CHECK_THROWS_EXCEPTION did not catch std::exception."); // ...or any exception type derived from it. PQXX_CHECK_THROWS_EXCEPTION( throw test_failure(__FILE__, __LINE__, "(expected)"), "PQXX_CHECK_THROWS_EXCEPTION() failed to catch expected exception."); // Any other type is an error. bool failed = true; try { PQXX_CHECK_THROWS_EXCEPTION(throw 1, "(expected)"); failed = false; } catch (const test_failure &) { } PQXX_CHECK( failed, "PQXX_CHECK_THROWS_EXCEPTION did not complain about non-exception."); // But there _must_ be an exception. failed = true; try { // If the test fails to throw, this throws a failure. PQXX_CHECK_THROWS_EXCEPTION(empty(), "(expected)"); // So we shouldn't get to this point. failed = false; } catch (const test_failure &) { // Instead, we go straight here. } PQXX_CHECK( failed, "PQXX_CHECK_THROWS_EXCEPTION did not notice missing exception."); // PQXX_CHECK_THROWS_EXCEPTION can test itself... PQXX_CHECK_THROWS_EXCEPTION( PQXX_CHECK_THROWS_EXCEPTION(empty(), "(expected)"), "PQXX_CHECK_THROWS_EXCEPTION failed to throw for missing exception."); PQXX_CHECK_THROWS_EXCEPTION( PQXX_CHECK_THROWS_EXCEPTION(throw 1, "(expected)"), "PQXX_CHECK_THROWS_EXCEPTION ignored wrong exception type."); } // Test PQXX_CHECK_THROWS. void test_check_throws() { PQXX_CHECK_THROWS( throw test_failure(__FILE__, __LINE__, "(expected)"), test_failure, "PQXX_CHECK_THROWS() failed to catch expected exception."); // Even if it's not std::exception-derived. PQXX_CHECK_THROWS(throw 1, int, "(expected)"); // PQXX_CHECK_THROWS means there _must_ be an exception. bool failed = true; try { // If the test fails to throw, PQXX_CHECK_THROWS throws a failure. PQXX_CHECK_THROWS(empty(), std::runtime_error, "(expected)"); // So we shouldn't get to this point. failed = false; } catch (const test_failure &) { // Instead, we go straight here. } PQXX_CHECK(failed, "PQXX_CHECK_THROWS did not notice missing exception."); // The exception must be of the right type (or a subclass of the right type). failed = true; try { // If the test throws the wrong type, PQXX_CHECK_THROWS throws a failure. PQXX_CHECK_THROWS(throw std::exception(), test_failure, "(expected)"); failed = false; } catch (const test_failure &) { // Instead, we go straight here. } PQXX_CHECK(failed, "PQXX_CHECK_THROWS did not notice wrong exception type."); // PQXX_CHECK_THROWS can test itself... PQXX_CHECK_THROWS( PQXX_CHECK_THROWS(empty(), test_failure, "(expected)"), test_failure, "PQXX_CHECK_THROWS failed to throw for missing exception."); PQXX_CHECK_THROWS( PQXX_CHECK_THROWS(throw 1, std::runtime_error, "(expected)"), test_failure, "PQXX_CHECK_THROWS failed to throw for wrong exception type."); } void test_test_helpers() { test_check_notreached(); test_check(); test_check_throws_exception(); test_check_throws(); // Test other helpers against PQXX_CHECK_THROWS. PQXX_CHECK_THROWS( PQXX_CHECK_NOTREACHED("(expected)"), test_failure, "PQXX_CHECK_THROWS did not catch PQXX_CHECK_NOTREACHED."); PQXX_CHECK_THROWS( PQXX_CHECK(false, "(expected)"), test_failure, "PQXX_CHECK_THROWS did not catch failing PQXX_CHECK."); PQXX_CHECK_THROWS( PQXX_CHECK_THROWS( PQXX_CHECK(true, "(shouldn't happen)"), test_failure, "(expected)"), test_failure, "PQXX_CHECK_THROWS on successful PQXX_CHECK failed to throw."); // PQXX_CHECK_EQUAL tests for equality. Its arguments need not be of the same // type, as long as equality between them is defined. PQXX_CHECK_EQUAL(1, 1, "PQXX_CHECK_EQUAL is broken."); PQXX_CHECK_EQUAL(1, 1L, "PQXX_CHECK_EQUAL breaks on type mismatch."); PQXX_CHECK_THROWS( PQXX_CHECK_EQUAL(1, 2, "(expected)"), test_failure, "PQXX_CHECK_EQUAL fails to spot inequality."); // PQXX_CHECK_NOT_EQUAL is like PQXX_CHECK_EQUAL, but tests for inequality. PQXX_CHECK_NOT_EQUAL(1, 2, "PQXX_CHECK_NOT_EQUAL is broken."); PQXX_CHECK_THROWS( PQXX_CHECK_NOT_EQUAL(1, 1, "(expected)"), test_failure, "PQXX_CHECK_NOT_EQUAL fails to fail when arguments are equal."); PQXX_CHECK_THROWS( PQXX_CHECK_NOT_EQUAL(1, 1L, "(expected)"), test_failure, "PQXX_CHECK_NOT_EQUAL breaks on type mismatch."); // PQXX_CHECK_BOUNDS checks a value against a range. PQXX_CHECK_BOUNDS(2, 1, 3, "PQXX_CHECK_BOUNDS wrongly finds fault."); PQXX_CHECK_THROWS( PQXX_CHECK_BOUNDS(1, 2, 3, "(Expected)"), test_failure, "PQXX_CHECK_BOUNDS did not detect value below permitted range."); // PQXX_CHECK_BOUNDS tests against a half-open interval. PQXX_CHECK_BOUNDS(1, 1, 3, "PQXX_CHECK_BOUNDS goes wrong on lower bound."); PQXX_CHECK_THROWS( PQXX_CHECK_BOUNDS(3, 1, 3, "(Expected)"), test_failure, "PQXX_CHECK_BOUNDS interval is not half-open."); // PQXX_CHECK_BOUNDS deals well with empty intervals. PQXX_CHECK_THROWS( PQXX_CHECK_BOUNDS(1, 2, 1, "(Expected)"), test_failure, "PQXX_CHECK_BOUNDS did not detect empty interval."); } PQXX_REGISTER_TEST(test_test_helpers); } // namespace libpqxx-6.4.5/test/unit/test_thread_safety_model.cxx000066400000000000000000000010221350065432700227400ustar00rootroot00000000000000#include "../test_helpers.hxx" #include using namespace pqxx; namespace { void test_thread_safety_model() { const thread_safety_model model = describe_thread_safety(); if (model.safe_libpq and model.safe_kerberos) PQXX_CHECK_EQUAL( model.description, "", "Thread-safety looks okay but model description is nonempty."); else PQXX_CHECK_NOT_EQUAL( model.description, "", "Thread-safety model is imperfect but lacks description."); } PQXX_REGISTER_TEST(test_thread_safety_model); } // namespace libpqxx-6.4.5/test/unit/test_transaction_base.cxx000066400000000000000000000030671350065432700222700ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_exec0(transaction_base &trans) { result E = trans.exec0("SELECT * FROM pg_tables WHERE 0 = 1"); PQXX_CHECK(E.empty(), "Nonempty result from exec0."); PQXX_CHECK_THROWS( trans.exec0("SELECT 99"), unexpected_rows, "Nonempty exec0 result did not throw unexpected_rows."); } void test_exec1(transaction_base &trans) { row R = trans.exec1("SELECT 99"); PQXX_CHECK_EQUAL(R.size(), size_t(1), "Wrong size result from exec1."); PQXX_CHECK_EQUAL(R.front().as(), 99, "Wrong result from exec1."); PQXX_CHECK_THROWS( trans.exec1("SELECT * FROM pg_tables WHERE 0 = 1"), unexpected_rows, "Empty exec1 result did not throw unexpected_rows."); PQXX_CHECK_THROWS( trans.exec1("SELECT * FROM generate_series(1, 2)"), unexpected_rows, "Two-row exec1 result did not throw unexpected_rows."); } void test_exec_n(transaction_base &trans) { result R = trans.exec_n(3, "SELECT * FROM generate_series(1, 3)"); PQXX_CHECK_EQUAL(R.size(), size_t(3), "Wrong result size from exec_n."); PQXX_CHECK_THROWS( trans.exec_n(2, "SELECT * FROM generate_series(1, 3)"), unexpected_rows, "exec_n did not throw unexpected_rows for an undersized result."); PQXX_CHECK_THROWS( trans.exec_n(4, "SELECT * FROM generate_series(1, 3)"), unexpected_rows, "exec_n did not throw unexpected_rows for an oversized result."); } void test_transaction_base() { connection conn; work tx{conn}; test_exec_n(tx); test_exec0(tx); test_exec1(tx); } PQXX_REGISTER_TEST(test_transaction_base); } // namespace libpqxx-6.4.5/test/unit/test_transactor.cxx000066400000000000000000000065771350065432700211420ustar00rootroot00000000000000#include "../test_helpers.hxx" using namespace pqxx; namespace { void test_transactor_newstyle_executes_simple_query() { connection conn; const auto r = pqxx::perform( [&conn]{return work{conn}.exec("SELECT generate_series(1, 4)");}); PQXX_CHECK_EQUAL(r.size(), 4u, "Unexpected result size."); PQXX_CHECK_EQUAL(r.columns(), 1u, "Unexpected number of columns."); PQXX_CHECK_EQUAL(r[0][0].as(), 1, "Unexpected first row."); PQXX_CHECK_EQUAL(r[3][0].as(), 4, "Unexpected last row."); } void test_transactor_newstyle_can_return_void() { bool done = false; perform([&done]{ done = true; }); PQXX_CHECK(done, "Callback was not executed."); } void test_transactor_newstyle_completes_upon_success() { int attempts = 0; perform([&attempts](){ attempts++; }); PQXX_CHECK_EQUAL(attempts, 1, "Successful transactor didn't run 1 time."); } void test_transactor_newstyle_retries_broken_connection() { int counter = 0; const auto &callback = [&counter]{ ++counter; if (counter == 1) throw pqxx::broken_connection(); return counter; }; const int result = pqxx::perform(callback); PQXX_CHECK_EQUAL(result, 2, "Transactor run returned wrong result."); PQXX_CHECK_EQUAL(counter, result, "Number of retries does not match."); } void test_transactor_newstyle_retries_rollback() { int counter = 0; const auto &callback = [&counter]{ ++counter; if (counter == 1) throw pqxx::transaction_rollback("Simulated error"); return counter; }; const int result = pqxx::perform(callback); PQXX_CHECK_EQUAL(result, 2, "Transactor run returned wrong result."); PQXX_CHECK_EQUAL(counter, result, "Number of retries does not match."); } void test_transactor_newstyle_does_not_retry_in_doubt_error() { int counter = 0; const auto &callback = [&counter]{ ++counter; throw pqxx::in_doubt_error("Simulated error"); }; PQXX_CHECK_THROWS( pqxx::perform(callback), in_doubt_error, "Transactor did not propagate in_doubt_error."); PQXX_CHECK_EQUAL(counter, 1, "Transactor retried after in_doubt_error."); } void test_transactor_newstyle_does_not_retry_other_error() { int counter = 0; const auto &callback = [&counter]{ ++counter; throw std::runtime_error("Simulated error"); }; PQXX_CHECK_THROWS( pqxx::perform(callback), std::runtime_error, "Transactor did not propagate std exception."); PQXX_CHECK_EQUAL(counter, 1, "Transactor retried after std exception."); } void test_transactor_newstyle_repeats_up_to_given_number_of_attempts() { const int attempts = 5; int counter = 0; const auto &callback = [&counter]{ ++counter; throw pqxx::transaction_rollback("Simulated error"); }; PQXX_CHECK_THROWS( pqxx::perform(callback, attempts), pqxx::transaction_rollback, "Not propagating original exception."); PQXX_CHECK_EQUAL(counter, attempts, "Number of retries does not match."); } void test_transactor() { test_transactor_newstyle_executes_simple_query(); test_transactor_newstyle_can_return_void(); test_transactor_newstyle_completes_upon_success(); test_transactor_newstyle_retries_broken_connection(); test_transactor_newstyle_retries_rollback(); test_transactor_newstyle_does_not_retry_in_doubt_error(); test_transactor_newstyle_does_not_retry_other_error(); test_transactor_newstyle_repeats_up_to_given_number_of_attempts(); } PQXX_REGISTER_TEST(test_transactor); } // namespace libpqxx-6.4.5/test/unit/test_types.hxx000066400000000000000000000140571350065432700201230ustar00rootroot00000000000000/* * Custom types for testing & libpqxx support those types */ #include #include #include #include #include #include #include #include class ipv4 { public: ipv4() : m_as_int{0u} {} ipv4(const ipv4 &) =default; ipv4(ipv4 &&) =default; explicit ipv4(uint32_t i) : m_as_int{i} {} ipv4( unsigned char b1, unsigned char b2, unsigned char b3, unsigned char b4 ) : m_as_int{uint32_t(b1) << 24 | uint32_t(b2) << 16 | uint32_t(b3) << 8 | b4} {} bool operator==(const ipv4 &o) const { return m_as_int == o.m_as_int; } ipv4 &operator=(const ipv4 &) =default; /// Index bytes, from 0 to 3, in network (i.e. Big-Endian) byte order. unsigned int operator[](int byte) const { if (byte < 0 or byte > 3) throw pqxx::usage_error("Byte out of range."); const auto shift = compute_shift(byte); return static_cast((m_as_int >> shift) & 0xff); } /// Set individual byte, in network byte order. void set_byte(int byte, uint32_t value) { const auto shift = unsigned(compute_shift(byte)); const auto blanked = m_as_int & ~uint32_t(0xff << shift); m_as_int = blanked | ((value & 0xff) << shift); } private: static uint32_t compute_shift(int byte) { if (byte < 0 or byte > 3) throw pqxx::usage_error("Byte out of range."); return uint32_t((3 - byte) * 8); } uint32_t m_as_int; }; using bytea = std::vector; template class custom_optional { // Very basic, only has enough features for testing private: union { // "Blank" member just so no T object needs to be constructed here. void *_; T value; }; bool has_value; public: custom_optional() : has_value{false} {} custom_optional(std::nullptr_t) : has_value{false} {} custom_optional(const custom_optional &o) : has_value{o.has_value} { if (has_value) new(&value) T(o.value); } custom_optional(const T& v) : value{v}, has_value{true} {} ~custom_optional() { if (has_value) value.~T(); } explicit operator bool() const { return has_value; } T &operator *() { if (has_value) return value; else throw std::logic_error{"bad optional access"}; } const T &operator *() const { if (has_value) return value; else throw std::logic_error{"bad optional access"}; } custom_optional &operator =(const custom_optional &o) { if (&o == this) return *this; if (has_value and o.has_value) value = o.value; else { if (has_value) value.~T(); if (o.has_value) new(&value) T(o.value); } has_value = o.has_value; return *this; } custom_optional &operator =(std::nullptr_t) { if (has_value) value.~T(); has_value = false; return *this; } }; namespace pqxx { template<> struct string_traits { using subject_type = ipv4; static constexpr const char* name() noexcept { return "ipv4"; } static constexpr bool has_null() noexcept { return false; } static bool is_null(const subject_type &) { return false; } [[noreturn]] static subject_type null() { internal::throw_null_conversion(name()); } static void from_string(const char str[], subject_type &ts) { if (str == nullptr) internal::throw_null_conversion(name()); std::regex ipv4_regex{ "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})" }; std::smatch match; // Need non-temporary for `std::regex_match()` std::string sstr{str}; if (not std::regex_match(sstr, match, ipv4_regex) or match.size() != 5) throw std::runtime_error{ "invalid ipv4 format: " + std::string{str} }; try { for (std::size_t i{0}; i < 4; ++i) ts.set_byte(int(i), uint32_t(std::stoi(match[i+1]))); } catch (const std::invalid_argument&) { throw std::runtime_error{ "invalid ipv4 format: " + std::string{str} }; } catch (const std::out_of_range&) { throw std::runtime_error{ "invalid ipv4 format: " + std::string{str} }; } } static std::string to_string(const subject_type &ts) { return std::to_string(ts[0]) + "." + std::to_string(ts[1]) + "." + std::to_string(ts[2]) + "." + std::to_string(ts[3]) ; } }; } // namespace pqxx namespace pqxx { template<> struct string_traits { private: static unsigned char from_hex(char c) { if (c >= '0' and c <= '9') return static_cast(c - '0'); else if (c >= 'a' and c <= 'f') return static_cast(c - 'a' + 10); else if (c >= 'A' and c <= 'F') return static_cast(c - 'A' + 10); else throw std::range_error{ "Not a hexadecimal digit: " + std::string{c} + " (value " + std::to_string(static_cast(c)) + ")." }; } static unsigned char from_hex(char c1, char c2) { return static_cast( (from_hex(c1) << 4) | (from_hex(c2) & 0x0f) ); } public: using subject_type = bytea; static constexpr const char* name() noexcept { return "bytea"; } static constexpr bool has_null() noexcept { return false; } static bool is_null(const subject_type &) { return false; } [[noreturn]] static subject_type null() { internal::throw_null_conversion( name() ); } static void from_string(const char str[], subject_type& bs) { if (str == nullptr) internal::throw_null_conversion(name()); auto len = strlen(str); if (len % 2 or len < 2 or str[0] != '\\' or str[1] != 'x') throw std::runtime_error{ "invalid bytea format: " + std::string{str} }; bs.clear(); for (std::size_t i{2}; i < len; /**/) { bs.emplace_back(from_hex(str[i], str[i + 1])); i += 2; } } static std::string to_string(const subject_type &bs) { std::stringstream s; s << "\\x" << std::hex; for (auto b : bs) s << std::setw(2) << std::setfill('0') << static_cast(b) ; return s.str(); } }; } // namespace pqxx libpqxx-6.4.5/tools/000077500000000000000000000000001350065432700143625ustar00rootroot00000000000000libpqxx-6.4.5/tools/Makefile.am000066400000000000000000000011531350065432700164160ustar00rootroot00000000000000EXTRA_DIST = \ extract_version \ lint \ release \ rmlo.cxx \ splitconfig \ template2mak.py \ pqxxthreadsafety.cxx AM_CPPFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include ${POSTGRES_INCLUDE} # Override automatically generated list of default includes. It contains only # unnecessary entries, and incorrectly mentions include/pqxx directly. DEFAULT_INCLUDES= noinst_PROGRAMS = rmlo pqxxthreadsafety rmlo_SOURCES = rmlo.cxx rmlo_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} pqxxthreadsafety_SOURCES = pqxxthreadsafety.cxx pqxxthreadsafety_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} libpqxx-6.4.5/tools/Makefile.in000066400000000000000000000454461350065432700164440ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = rmlo$(EXEEXT) pqxxthreadsafety$(EXEEXT) subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_pqxxthreadsafety_OBJECTS = pqxxthreadsafety.$(OBJEXT) pqxxthreadsafety_OBJECTS = $(am_pqxxthreadsafety_OBJECTS) am__DEPENDENCIES_1 = pqxxthreadsafety_DEPENDENCIES = $(top_builddir)/src/libpqxx.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_rmlo_OBJECTS = rmlo.$(OBJEXT) rmlo_OBJECTS = $(am_rmlo_OBJECTS) rmlo_DEPENDENCIES = $(top_builddir)/src/libpqxx.la \ $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(pqxxthreadsafety_SOURCES) $(rmlo_SOURCES) DIST_SOURCES = $(pqxxthreadsafety_SOURCES) $(rmlo_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ EXTRA_DIST = \ extract_version \ lint \ release \ rmlo.cxx \ splitconfig \ template2mak.py \ pqxxthreadsafety.cxx AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include ${POSTGRES_INCLUDE} # Override automatically generated list of default includes. It contains only # unnecessary entries, and incorrectly mentions include/pqxx directly. DEFAULT_INCLUDES = rmlo_SOURCES = rmlo.cxx rmlo_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} pqxxthreadsafety_SOURCES = pqxxthreadsafety.cxx pqxxthreadsafety_LDADD = $(top_builddir)/src/libpqxx.la ${POSTGRES_LIB} all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list pqxxthreadsafety$(EXEEXT): $(pqxxthreadsafety_OBJECTS) $(pqxxthreadsafety_DEPENDENCIES) $(EXTRA_pqxxthreadsafety_DEPENDENCIES) @rm -f pqxxthreadsafety$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(pqxxthreadsafety_OBJECTS) $(pqxxthreadsafety_LDADD) $(LIBS) rmlo$(EXEEXT): $(rmlo_OBJECTS) $(rmlo_DEPENDENCIES) $(EXTRA_rmlo_DEPENDENCIES) @rm -f rmlo$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rmlo_OBJECTS) $(rmlo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pqxxthreadsafety.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmlo.Po@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/tools/extract_version000077500000000000000000000024541350065432700175340ustar00rootroot00000000000000#! /bin/sh set -eu ARG="${1:-}" # Source directory. In out-of-tree builds, Automake sets this for us. srcdir=${srcdir:-.} # Print usage information. usage() { cat <... Acceptable option values are: -h, --help Print this message, and exit. -a, --abi Show libpqxx ABI version; leave out revision number. -f, --full Show full libpqxx version string (the default). -M, --major Show major libpqxx version. -m, --minor Show minor libpqxx version (between major and revision). EOF } # Print "unknown argument" error. unknown_arg() { cat <&2 Unknown argument: $1. Try $0 --help for usage information. EOF } case "$ARG" in ''|-f|--full) # Default: Print full version. cat $srcdir/VERSION ;; -h|--help) # Print usage information, and exit. usage exit ;; -a|--abi) # Print just the ABI version (major & minor). sed -e 's/^\([^.]*\.[^.]*\)\..*/\1/' $srcdir/VERSION ;; -M|--major) # Print the major version number. sed -e 's/^\([^.]*\)\..*/\1/' $srcdir/VERSION ;; -m|--minor) # Print the minor version number. sed -e 's/^[^.]*\.\([^.]*\)\..*/\1/' $srcdir/VERSION ;; *) unknown_arg $ARG exit 1 ;; esac libpqxx-6.4.5/tools/lint000077500000000000000000000041231350065432700152560ustar00rootroot00000000000000#! /bin/sh # # Routine sanity checks for libpqxx source tree. # # Usage: lint [srcdir] # # srcdir is the source directory; it defaults to the current directory but # may be set for out-of-tree builds. set -e set -u # Source directory. Automake sets this for us on out-of-tree builds. srcdir=${srcdir:-.} PQXXVERSION="$($srcdir/tools/extract_version)" # This version must be at the top of the NEWS file. check_news_version() { if ! head -n1 $srcdir/NEWS | grep -q "^$PQXXVERSION\$" then cat <&2 Version $PQXXVERSION is not at the top of NEWS. EOF exit 1 fi } # Count number of times header $1 is included from each of given input files. # Output is lines of :, one line per file, sorted. count_includes() { local HEADER_NAME WS PAT HEADER_NAME="$1" shift WS="[[:space:]]*" PAT="^${WS}#${WS}include${WS}[<\"]$HEADER_NAME[>\"]" grep -c "$PAT" $* | sort } # Any file that includes compiler-internal-pre.hxx must also include # compiler-internal-post.hxx, and vice versa. check_compiler_internal_headers() { local TEMPDIR PRE POST HEADERS TEMPDIR="$(mktemp --tmpdir -d pqxx-lint.XXXX)" if test -z "$TEMPDIR" then echo >&2 "Could not create temporary directory." exit 1 fi PRE="$TEMPDIR/pre" POST="$TEMPDIR/post" HEADERS=$(find $srcdir/include/pqxx/* -type f) count_includes $srcdir/pqxx/compiler-internal-pre.hxx $HEADERS >"$PRE" count_includes $srcdir/pqxx/compiler-internal-post.hxx $HEADERS >"$POST" DIFF="$(diff "$PRE" "$POST")" || /bin/true rm -r -- "$TEMPDIR" if test -n "$DIFF" then cat <&2 The number of inclusions of compiler-internal.post.hxx does not match the number of inclusions of compiler-internal.post.hxx: $DIFF EOF exit 1 fi } cpplint() { if which cppcheck >/dev/null then cppcheck -q -j$(nproc) -I include src/*.cxx test/*.cxx test/unit/*.cxx fi } pylint() { local PYFILES="$srcdir/tools/*.py $srcdir/tools/splitconfig" if which pocketlint >/dev/null then pocketlint $PYFILES fi if which flake8 >/dev/null then flake8 $PYFILES fi } cpplint pylint check_news_version check_compiler_internal_headers libpqxx-6.4.5/tools/pqxx-fulltest000077500000000000000000000176501350065432700171610ustar00rootroot00000000000000#! /bin/sh -e # Full test suite. Run libpqxx tests against a rich sampling of available # compilers, libpq versions, and backend versions. TESTDIR="$HOME/tmp/libpqxxtest" TMPDIR="$TESTDIR/tmp" OPTIMIZING_COMPILERS="g++ clang++" POSTGRES_VERSION_PATTERN="^v[91][0-9A-Za-z_.-]\+" POSTGRES_FTP_SERVER="${PG_FTPSERVER:-ftp.postgresql.org}" POSTGRES_FTP_DIR="${PG_FTPDIR:-pub/source}" if which nproc >/dev/null then PROCESSORS=$(nproc) else PROCESSORS=2 fi CONCURRENCY_LEVEL="${CONCURRENCY_LEVEL:-${PROCESSORS}}" mkdir -p "$TMPDIR" log_message() { echo "\n" date --iso-8601=second echo "*** $1 ***" echo } check_for_compilers() { local POTENTIAL_COMPILER for POTENTIAL_COMPILER in $1 do which "$POTENTIAL_COMPILER" done } get_tarball() { # Print full path of libpqxx tarball in current directory. echo "$(pwd)/libpqxx-$(cat VERSION).tar.gz" } build_tarball() { # Produce a lipqxx tarball. log_message "Creating tarball" rm -f -- "$(get_tarball)" env CXXFLAGS= ./autogen.sh make dist -j$CONCURRENCY_LEVEL } unpack_tarball() { # Unpack libpqxx tarball, set it up for building. tar xf "$1" echo "$(pwd)/$(ls -c -d -v libpqxx-* | tail -n1)" } find_backend_dir() { local FBD_OLD_PWD FBD_OLD_PWD="$(pwd)" cd -- "$TESTDIR/pg/$1" pwd cd -- "$FBD_OLD_PWD" } locate_pidfile() { echo "$(find_backend_dir "$1")/postgres.pid" } start_backend() { # Start up a PostgreSQL backend. local ARG_BACKEND BACKEND_DIR SB_OLD_PWD log_message "Starting backend $1" ARG_BACKEND="$1" BACKEND_DIR="$(find_backend_dir "$ARG_BACKEND")" SB_OLD_PWD="$(pwd)" cd "$TESTDIR/pg" if test -f "$BACKEND_DIR/PQXX_SKIP" then echo "\n\nSkipping backend $ARG_BACKEND.\n" false else # Use postmaster, not postgres; "postgres" didn't support the # -h or -k options until version 8.2, and we need both. env PATH="$BACKEND_DIR/bin:$PATH:/sbin" \ LD_LIBRARY_PATH="$BACKEND_DIR/lib" \ PGDATA="$BACKEND_DIR/data" \ start-stop-daemon -b -m -p "$(locate_pidfile "$ARG_BACKEND")" \ --oknodo -S -x "$BACKEND_DIR/bin/postmaster" -- \ -F -h '' -k "$BACKEND_DIR" \ >"$BACKEND_DIR/backend.log" 2>&1 fi cd "$SB_OLD_PWD" } stop_backend() { local BACKEND_PIDFILE log_message "Stopping backend $1" BACKEND_PIDFILE="$(locate_pidfile "$1")" if PATH="$PATH:/sbin" start-stop-daemon -p "$BACKEND_PIDFILE" -K then rm -- "$BACKEND_PIDFILE" fi } augment_postgres_config() { # Tweak configuration for backend $1. local BACKEND_CONFIG BACKEND_CONFIG="$1/data/postgresql.conf" if ! grep -- '^fsync = false' "$BACKEND_CONFIG" then log_message "Disabling fsync in $BACKEND_CONFIG" cat <>"$BACKEND_CONFIG" # Don't bother syncing to disk. fsync = false #unix_socket_directory = "$BACKEND_DIR" EOF fi } build_postgres() { log_message "Building postgres for installation to $1" ./configure --without-readline --prefix="$1" make -j$CONCURRENCY_LEVEL } create_database() { local PQXX_USER BACKEND_DIR PQXX_USER="$(whoami)" log_message "(Re-)creating database $PQXX_USER in $1" BACKEND_DIR="$(find_backend_dir "$1")" env PGHOST="$BACKEND_DIR" \ LD_LIBRARY_PATH="$BACKEND_DIR/lib" \ PATH="$BACKEND_DIR/bin:$PATH" \ createdb "$PQXX_USER" || /bin/true } install_postgres() { # Download, build, and install a postgres version. local ARG_VERSION_NAME STRIPPED_VERSION BASE_NAME PG_TARBALL \ DOWNLOAD_PATH PG_URL INSTALL_DIR IP_OLD_PWD ARG_VERSION_NAME="$1" STRIPPED_VERSION="$(echo "$ARG_VERSION_NAME" | sed -e 's/^v//')" BASE_NAME="postgresql-$STRIPPED_VERSION" PG_TARBALL="$BASE_NAME.tar.bz2" DOWNLOAD_PATH="$ARG_VERSION_NAME/$PG_TARBALL" PG_URL="ftp://$POSTGRES_FTP_SERVER/$POSTGRES_FTP_DIR/$DOWNLOAD_PATH" INSTALL_DIR="$TESTDIR/pg/$ARG_VERSION_NAME" IP_OLD_PWD="$(pwd)" log_message "Downloading $PG_TARBALL" if wget -q "$PG_URL" then tar xf "$PG_TARBALL" rm -f -- "$PG_TARBALL" cd -- "$BASE_NAME" if build_postgres "$INSTALL_DIR" then make install env PATH="$INSTALL_DIR/bin:$PATH" \ LD_LIBRARY_PATH="$INSTALL_DIR/lib" \ PGDATA="$INSTALL_DIR/data" \ initdb >/dev/null augment_postgres_config "$INSTALL_DIR" fi cd .. rm -rf -- "./$BASE_NAME" cd -- "$IP_OLD_PWD" fi } find_upstream_postgreses() { lftp "$POSTGRES_FTP_SERVER" -e "cls -1 -B $POSTGRES_FTP_DIR ; exit" | grep -o "$POSTGRES_VERSION_PATTERN" } find_installed_postgreses() { local FIP_OLD_PWD SKIP FIP_OLD_PWD="$(pwd)" cd -- "$TESTDIR/pg" SKIP="$(find v* -maxdepth 1 -name PQXX_SKIP | sed -e 's|/.*||')" ls -1 | grep -o "$POSTGRES_VERSION_PATTERN" | grep -vFx "$SKIP" cd -- "$FIP_OLD_PWD" } stop_all_backends() { local SAB_BACKENDS STOPPABLE_BACKEND SAB_BACKENDS=$(find_installed_postgreses) for STOPPABLE_BACKEND in $SAB_BACKENDS do stop_backend $STOPPABLE_BACKEND done } prepare_postgreses() { local PP_OLD_PWD DOWNLOADABLE AVAILABLE_BACKENDS PREPARE_BACKEND PP_OLD_PWD="$(pwd)" for DOWNLOADABLE in $(find_upstream_postgreses) do if ! test -d "$TESTDIR/pg/$DOWNLOADABLE" then cd -- "$TESTDIR/tmp" install_postgres "$DOWNLOADABLE" cd -- "$PP_OLD_PWD" fi done stop_all_backends sleep 5 AVAILABLE_BACKENDS=$(find_backends) for PREPARE_BACKEND in $AVAILABLE_BACKENDS do start_backend "$PREPARE_BACKEND" sleep 2 done sleep 5 for PREPARE_BACKEND in $AVAILABLE_BACKENDS do create_database "$PREPARE_BACKEND" || /bin/true done } find_historic_compilers() { local COMPILERS COMPILERS="$(find /usr/bin /usr/local/bin -name g++-[0-9].[0-9])" # TODO: Any way we can skip the one that g++ links to? echo ${COMPILERS:-c++} } test_against_compilers() { local COMPILER log_message "Testing against compilers: $1" for COMPILER in $1 do log_message "Testing against $COMPILER" env CXX=${COMPILER} ./configure \ --enable-shared \ --enable-maintainer-mode \ --disable-documentation make check -j$CONCURRENCY_LEVEL || exit 1 done } find_frontends() { # Find frontends to test against. find_installed_postgreses } find_backends() { # Find backends to test against. # Just sample the oldest & newest available major versions. find_installed_postgreses | head -n1 find_installed_postgreses | tail -n1 } test_against_postgreses() { local ARG_FRONTENDS ARG_BACKENDS TEST_FRONTEND TEST_FRONTEND_DIR \ EXTENDED_PATH LIB_PATH TEST_BACKEND ARG_FRONTENDS=$1 ARG_BACKENDS=$2 for TEST_FRONTEND in $ARG_FRONTENDS do log_message "Building against frontend $TEST_FRONTEND" TEST_FRONTEND_DIR="$(find_backend_dir "$TEST_FRONTEND")" EXTENDED_PATH="$TEST_FRONTEND_DIR/bin:$PATH" LIB_PATH="$TEST_FRONTEND_DIR/lib" env PATH="$EXTENDED_PATH" LD_LIBRARY_PATH="$LIB_PATH" \ ./configure \ --enable-shared \ --enable-maintainer-mode \ --disable-documentation env PATH="$EXTENDED_PATH" LD_LIBRARY_PATH="$LIB_PATH" \ make -j$CONCURRENCY_LEVEL for TEST_BACKEND in $ARG_BACKENDS do log_message "Testing against backend $TEST_BACKEND" TEST_BACKEND_DIR="$(find_backend_dir "$TEST_BACKEND")" env PGHOST="$TEST_BACKEND_DIR" \ PATH="$EXTENDED_PATH" \ LD_LIBRARY_PATH="$LIB_PATH" \ make check -j$CONCURRENCY_LEVEL || exit 1 done done } main() { local PQXX_TARBALL CURRENT_POSTGRES CURRENT_POSTGRES_DIR CURRENT_PATH \ CURRENT_LIB_PATH build_tarball PQXX_TARBALL="$(get_tarball)" cd -- "$TESTDIR" rm -rf build mv -- "$(unpack_tarball "$PQXX_TARBALL")" build mkdir -p pg prepare_postgreses CURRENT_POSTGRES="$(find_backends | tail -n 1)" CURRENT_POSTGRES_DIR="$(find_backend_dir "$CURRENT_POSTGRES")" CURRENT_PATH="$CURRENT_POSTGRES_DIR/bin:$PATH" CURRENT_LIB_PATH="$CURRENT_POSTGRES_DIR/lib" cd -- "$TESTDIR/build" PGHOST="$CURRENT_POSTGRES_DIR" export PGHOST LD_LIBRARY_PATH="$CURRENT_POSTGRES_DIR/lib" export LD_LIBRARY_PATH PATH="$CURRENT_POSTGRES_DIR/bin:$PATH" export PATH test_against_compilers "$(check_for_compilers "$OPTIMIZING_COMPILERS")" CXXFLAGS= export CXXFLAGS test_against_compilers "$(find_historic_compilers)" test_against_postgreses "$(find_frontends)" "$(find_backends)" stop_all_backends } log_message "Starting full libpqxx test" main log_message "Done" libpqxx-6.4.5/tools/pqxxthreadsafety.cxx000066400000000000000000000003011350065432700205040ustar00rootroot00000000000000// Print thread-safety information for present libpqxx build. #include #include "pqxx/util" int main() { std::cout << pqxx::describe_thread_safety().description << std::endl; } libpqxx-6.4.5/tools/pre-release-check000077500000000000000000000014061350065432700175700ustar00rootroot00000000000000#! /bin/sh -e # # Pre-release checks for libpqxx. Run from the subversion tag directory for the # version that is to be released. # # Returns 0 if the branch appears ready for release. PQXXVERSION="$(./tools/extract_version)" # There must be no uncommitted changes. check_uncommitted_changes() { local UNCOMMITTED_CHANGES UNCOMMITTED_CHANGES="$(svn st)" if test -n "$UNCOMMITTED_CHANGES" then cat <&2 Branch has uncommitted changes: $UNCOMMITTED_CHANGES EOF exit 1 fi } # We must be in the tag directory for the right release. check_version_tag() { if ! pwd | grep -q "/tags/$PQXXVERSION$" then cat <&2 This does not appear to be the tag directory for $PQXXVERSION. EOF exit 1 fi } ./tools/lint check_uncommitted_changes check_version_tag libpqxx-6.4.5/tools/release000077500000000000000000000044101350065432700157270ustar00rootroot00000000000000#! /bin/bash # Release current libpqxx trunk (or other branch). # # Use this after a successful full test run in the parent series. # # Arguments: # [parent] # # The next version number is the one for a future release in the parent series, # not the version that's being released now. So if you're releasing x.y.0, that # would be x.y+1.0. If you're releasing some other x.y.z, it's x.y.z+1. # # The parent branch defaults to "trunk." For x.y.z releases (where z > 0), use # branches/x.y. set -e NEXTVERSION="$1" if test -z "$NEXTVERSION" then echo "Usage: $0 [parent]" >&2 exit 1 fi PARENT="$2" if test -z "$PARENT" then PARENT="trunk" fi REPO="svn+ssh://pqxx.org/srv/svn/libpqxx/" FTP="/srv/ftp/libpqxx" SNAPSHOT="/home/jtv/public_html/tmp/pqxx/snapshot" DOC="/srv/www/devprojects/libpqxx/doc" CHECKOUT="$(mktemp -p /tmp -d pqxx.XXXXXXXXXX)" echo "** Checking out source tree to $CHECKOUT **" cd -- "$CHECKOUT" svn co -q "$REPO" cd libpqxx/ export PATH="$PATH:$CHECKOUT/libpqxx/$PARENT/tools" pushd "$PARENT" >/dev/null PQXXVERSION="$(extract_version)" popd >/dev/null if test "$PQXXVERSION" = "$NEXTVERSION" then cat <&2 The given "next version" is the same as the existing version in $PARENT/PQXXVERSION. Instead, give the next version for a future release in the same series. EOF exit 2 fi RELEASEDATE="$(date +'%a, %d %b %y %T %z')" echo "** Updating source tree **" svn cp "$PARENT" "tags/$PQXXVERSION" # Mark next version in NEWS. cat - <"$PARENT/NEWS" $NEXTVERSION EOF echo "PQXX_VERSION $NEXTVERSION" >"$PARENT"/VERSION cd /tmp echo "** Setting up new documentation **" TEMPDOC="$(mktemp -p /tmp -d pqxxdoc.XXXXXXXXXX)" cd -- "$TEMPDOC" tar xzf "$SNAPSHOT"/libpqxx-*.tar.gz cd libpqxx-*/ PREVIOUS='' for d in $(ls "$DOC" | grep '[0-9]') do PREVIOUS="$PREVIOUS --link-dest='$DOC/$d'" done rsync -r $PREVIOUS doc/html "$DOC/$PQXXVERSION" cd /tmp rm -rf "$TEMPDOC" if test "$PARENT" = "trunk" then # Move snapshot tarball to FTP directory. mv "$SNAPSHOT"/libpqxx-*.tar.* "$FTP/" else echo "*** Remember: Build tarball and make available for upload ***" fi cd -- "$CHECKOUT" svn commit -m "Forking release $PQXXVERSION, moving on to $NEXTVERSION." cd /tmp rm -rf -- "$CHECKOUT" echo "** Done **" libpqxx-6.4.5/tools/rmlo.cxx000066400000000000000000000013301350065432700160540ustar00rootroot00000000000000// Remove large objects given on the command line from the default database. #include #include "pqxx/pqxx" using namespace pqxx; int main(int, char *argv[]) { lazyconnection C; bool failures = false; try { for (int i=1; argv[i]; ++i) { oid O; from_string(argv[i], O); try { pqxx::perform([O, &C]{ work w{C}; largeobject l{O}; l.remove(w); w.commit(); }); } catch (const std::exception &e) { std::cerr << e.what() << std::endl; failures = true; } } } catch (const std::exception &e) { std::cerr << e.what() << std::endl; return 2; } return failures; } libpqxx-6.4.5/tools/sign-tarball000077500000000000000000000006341350065432700166720ustar00rootroot00000000000000#! /bin/sh # Add GPG signature and checksums for libpqxx tarball. # # Usage: # sign-tarball TARBALL="$1" if test -z "$TARBALL" then echo "No tarball to sign. Usage: $0 " >&2 exit 1 fi if ! test -f "$TARBALL" then echo "Can't find '$TARBALL'." >&2 exit 1 fi gpg --armor --sign --detach-sig "$TARBALL" for DIGEST in md5sum sha256sum do "$DIGEST" "$TARBALL" >"$TARBALL.$DIGEST" done libpqxx-6.4.5/tools/splitconfig000077500000000000000000000177661350065432700166520ustar00rootroot00000000000000#! /usr/bin/env python """Extract configuration items into various configuration headers. This uses the configitems file, a database consisting of text lines with the following single-tab-separated fields: - Name of the configuration item, e.g. PQXX_HAVE_PTRDIFF_T. - Publication marker: public or internal. - A single environmental factor determining the item, e.g. libpq or compiler. """ from __future__ import ( absolute_import, print_function, unicode_literals, ) from argparse import ArgumentParser import codecs from errno import ENOENT import os.path from os import getcwd import re from sys import ( getdefaultencoding, getfilesystemencoding, stdout, ) __metaclass__ = type def guess_fs_encoding(): """Try to establish the filesystem encoding. It's a sad thing: some guesswork is involved. The encoding often seems to be conservatively, and incorrectly, set to ascii. """ candidates = [ getfilesystemencoding(), getdefaultencoding(), 'utf-8', ] for encoding in candidates: lower = encoding.lower() if lower != 'ascii' and lower != 'ansi_x3.4-1968': return encoding raise AssertionError("unreachable code reached.") def guess_output_encoding(): """Return the encoding of standard output.""" # Apparently builds in Docker containers may have None as an encoding. # Fall back to ASCII. If this ever happens in a non-ASCII path, well, # there may be a more difficult decision to be made. We'll burn that # bridge when we get to it, as they almost say. return stdout.encoding or 'ascii' def decode_path(path): """Decode a path element from bytes to unicode string.""" return path.decode(guess_fs_encoding()) def encode_path(path): """Encode a path element from unicode string to bytes.""" # Nasty detail: unicode strings are stored as UTF-16. Which can contain # surrogate pairs. And those break in encoding, unless you use this # special error handler. return path.encode(guess_fs_encoding(), 'surrogateescape') def read_text_file(path, encoding='utf-8'): """Read text file, return as string, or `None` if file is not there.""" assert isinstance(path, type('')) try: with codecs.open(encode_path(path), encoding=encoding) as stream: return stream.read() except IOError as error: if error.errno == ENOENT: return None else: raise def read_lines(path, encoding='utf-8'): """Read text file, return as list of lines.""" assert isinstance(path, type('')) with codecs.open(encode_path(path), encoding=encoding) as stream: return list(stream) def read_configitems(filename): """Read the configuration-items database. :param filename: Path to the configitems file. :return: Sequence of text lines from configitems file. """ return [line.split() for line in read_lines(filename)] def map_configitems(items): """Map each config item to publication/factor. :param items: Sequence of config items: (name, publication, factor). :return: Dict mapping each item name to a tuple (publication, factor). """ return { item: (publication, factor) for item, publication, factor in items } def read_header(source_tree, filename): """Read the original config.h generated by autoconf. :param source_tree: Path to libpqxx source tree. :param filename: Path to the config.h file. :return: Sequence of text lines from config.h. """ assert isinstance(source_tree, type('')) assert isinstance(filename, type('')) return read_lines(os.path.join(source_tree, filename)) def extract_macro_name(config_line): """Extract a cpp macro name from a configuration line. :param config_line: Text line from config.h which may define a macro. :return: Name of macro defined in `config_line` if it is a `#define` statement, or None. """ config_line = config_line.strip() match = re.match('\s*#\s*define\s+([^\s]+)', config_line) if match is None: return None else: return match.group(1) def extract_section(header_lines, items, publication, factor): """Extract config items for given publication/factor from header lines. :param header_lines: Sequence of header lines from config.h. :param items: Dict mapping macro names to (publication, factor). :param publication: Extract only macros for this publication tag. :param factor: Extract only macros for this environmental factor. :return: Sequence of `#define` lines from `header_lines` insofar they fall within the requested section. """ return sorted( line.strip() for line in header_lines if items.get(extract_macro_name(line)) == (publication, factor) ) def compose_header(lines, publication, factor): """Generate header text containing given lines.""" intro = ( "/* Automatically generated from config.h: %s/%s config. */" % (publication, factor) ) return '\n'.join([intro, ''] + lines + ['']) def generate_config(source_tree, header_lines, items, publication, factor): """Generate config file for a given section, if appropriate. Writes nothing if the configuration file ends up either empty, or identical to one that's already there. :param source_tree: Location of the libpqxx source tree. :param header_lines: Sequence of header lines from config.h. :param items: Dict mapping macro names to (publication, factor). :param publication: Extract only macros for this publication tag. :param factor: Extract only macros for this environmental factor. """ assert isinstance(source_tree, type('')) config_file = os.path.join( source_tree, 'include', 'pqxx', 'config-%s-%s.h' % (publication, factor)) unicode_path = config_file.encode(guess_output_encoding(), 'replace') section = extract_section(header_lines, items, publication, factor) if len(section) == 0: print("Generating %s: no items--skipping." % unicode_path) return contents = compose_header(section, publication, factor) if read_text_file(config_file) == contents: print("Generating %s: no changes--skipping." % unicode_path) return print("Generating %s: %d item(s)." % (unicode_path, len(section))) path = encode_path(config_file) with codecs.open(path, 'wb', encoding='ascii') as header: header.write(contents) def parse_args(): """Parse command-line arguments.""" default_source_tree = os.path.dirname( os.path.dirname(os.path.normpath(os.path.abspath(__file__)))) parser = ArgumentParser(description=__doc__) parser.add_argument( 'sourcetree', metavar='PATH', default=default_source_tree, help="Location of libpqxx source tree. Defaults to '%(default)s'.") return parser.parse_args() def check_args(args): """Validate command-line arguments.""" if not os.path.isdir(args.sourcetree): raise Exception("Not a directory: '%s'." % args.sourcetree) def get_current_dir(): cwd = getcwd() if isinstance(cwd, bytes): return decode_path(cwd) else: return cwd def main(): """Main program entry point.""" args = parse_args() check_args(args) # The configitems file is under revision control; it's in sourcetree. items = read_configitems(os.path.join(args.sourcetree, 'configitems')) publications = sorted(set(item[1] for item in items)) factors = sorted(set(item[2] for item in items)) # The config.h header is generated; it's in the build tree, which should # be where we are. directory = get_current_dir() original_header = read_header( directory, os.path.join('include', 'pqxx', 'config.h')) items_map = map_configitems(items) for publication in publications: for factor in factors: generate_config( directory, original_header, items_map, publication, factor) if __name__ == '__main__': main() libpqxx-6.4.5/tools/template2mak.py000077500000000000000000000125071350065432700173320ustar00rootroot00000000000000#! /usr/bin/env python """Minimal macro processor. Used for generating VC++ makefiles. The available template commands are: Expand a template section for each file in a list of file patterns:: ###MAKTEMPLATE:FOREACH my/path*/*.cxx,other*.cxx ... ###MAKTEMPLATE:ENDFOREACH In the template section, you can use `###BASENAME###` to get the base name of the file being processed (e.g. "base" for "../base.cxx"), and you can use `###FILENAME###` to get the full filename. Copyright (c) 2006-2019, Bart Samwel and Jeroen T. Vermeulen. """ from __future__ import ( absolute_import, print_function, unicode_literals, ) from argparse import ( ArgumentError, ArgumentParser, RawDescriptionHelpFormatter, ) from contextlib import contextmanager from glob import glob import os from sys import ( argv, exit, stdin, stderr, stdout, ) from textwrap import dedent def expand_foreach_file(path, block, outfile): """Expand a "foreach" block for a single file path. Write the results to outfile. """ basepath, extension = os.path.splitext(os.path.basename(path)) for line in block: line = line.replace("###FILENAME###", path) line = line.replace("###BASENAME###", basepath) outfile.write(line) def match_globs(globs): """List all files matching any item in globs. Eliminates duplicates. """ return sorted({ path for pattern in globs for path in glob(pattern) }) def expand_foreach(globs, block, outfile): """Expand a foreach block for each file matching one of globs. Write the results to outfile. """ # We'll be iterating over block a variable number of times. Turn it # from a generic iterable into an immutable array. block = tuple(block) for path in match_globs(globs): expand_foreach_file(path, block, outfile) # Header to be prefixed to the generated file. OUTPUT_HEADER = dedent("""\ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's {script} script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The {script} script should be available in the tools directory of the # libpqxx source archive. """) foreach_marker = r"###MAKTEMPLATE:FOREACH " end_foreach_marker = r"###MAKTEMPLATE:ENDFOREACH" def parse_foreach(line): """Parse FOREACH directive, if line contains one. :param line: One line of template input. :return: A list of FOREACH globs, or None if this was not a FOREACH line. """ line = line.strip() if line.startswith(foreach_marker): return line[len(foreach_marker):].split(',') else: return None def read_foreach_block(infile): """Read a FOREACH block from infile (not including the FOREACH directive). Assumes that the FOREACH directive was in the preceding line. Consumes the line with the ENDFOREACH directive, but does not yield it. :return: Iterable of lines. """ for line in infile: if line.strip().startswith(end_foreach_marker): return yield line def expand_template(infile, outfile): """Expand the template in infile, and write the results to outfile.""" for line in infile: globs = parse_foreach(line) if globs is None: # Not a FOREACH line. Copy to output. outfile.write(line) else: block = read_foreach_block(infile) expand_foreach(globs, block, outfile) @contextmanager def open_stream(path=None, default=None, mode='r'): """Open file at given path, or yield default. Close as appropriate. The default should be a stream, not a path; closing the context will not close it. """ if path is None: yield default else: with open(path, mode) as stream: yield stream def parse_args(): """Parse command-line arguments. :return: Tuple of: input path (or None for stdin), output path (or None for stdout). """ parser = ArgumentParser( description=__doc__, formatter_class=RawDescriptionHelpFormatter) parser.add_argument( 'template', nargs='?', help="Input template. Defaults to standard input.") parser.add_argument( 'output', nargs='?', help="Output file. Defaults to standard output.") args = parser.parse_args() return args.template, args.output def write_header(stream, template_path=None): """ Write header to stream. """ hr = ("#" * 80) + "\n" script = os.path.basename(argv[0]) outstream.write(hr) outstream.write(OUTPUT_HEADER.format(script=script)) if template_path is not None: outstream.write("#\n") outstream.write("# Generated from template '%s'.\n" % template_path) outstream.write(hr) if __name__ == '__main__': try: template_path, output_path = parse_args() except ArgumentError as error: stderr.write('%s\n' % error) exit(2) input_stream = open_stream(template_path, stdin, 'r') output_stream = open_stream(output_path, stdout, 'w') with input_stream as instream, output_stream as outstream: write_header(outstream, template_path) expand_template(instream, outstream) libpqxx-6.4.5/win32/000077500000000000000000000000001350065432700141645ustar00rootroot00000000000000libpqxx-6.4.5/win32/INSTALL.txt000066400000000000000000000504721350065432700160430ustar00rootroot00000000000000Welcome to libpqxx, the C++ API to the PostgreSQL database management system. This file documents building and installation of libpqxx on Windows systems. Please see the regular README.md for general instructions on building, installing, and using the library. If you are using Cygwin, MSYS, or another Unix-like environment please try the Unix configuration & build procedure instead of the one described here. Some help for the MSYS/MinGW combination is given below, but in general, things are a bit more complicated for Windows than they are for other environments. The only Windows compilers currently documented here are: Visual C++ (the newer the better) MinGW If you are using a different compiler, you should still be able to get it to work. If you do, or if you fail, please report your results so any problems can be resolved, and so that we can add support for your compiler in the standard libpqxx distribution. We'll be using the command line throughout this document. Build Environment ----------------- If you use MSYS, you may need various additional tools (such as "mktemp") installed. If you use Visual C++, make sure you have at least the 2015 version or you'll run into serious compilation trouble. You may have to make some adjustments to these instructions and scripts for the build to succeeed. If you do, let us know so we can improve the procedure. Obtaining libpq --------------- Next, make sure you have a working installation of libpq, the C-level client library included with PostgreSQL. There are two ways to make libpq available on a Windows system: Install it, or build it from sources. Either way, make sure that you get the right build: don't mix 32-bit and 64-bit libraries, or ones built for "debug" and "release." Installing libpq ---------------- The easiest way to get libpq on a Windows system, is to install PostgreSQL. The PostgreSQL installer from Windows can be obtained from http://www.postgresql.org/download/windows This build procedure has been tested against installes done by the One Click Installer. If you opt for the pgInstaller, you will have to make some adjustments to these instructions and scripts for the build to succeeed. By default, for some `{Version}` of postgres, the installer sets up libpq under: C:\Program Files\PostgreSQL\{Version}\lib Building libpq from source -------------------------- If you prefer to build libpq from source, you can compile a recent version of PostgreSQL. Its source tree should then contain libpq in binary form, as well as the corresponding headers. Look for these in src/interfaces/libpq. Visual C++ will generate separate Debug and Release versions in subdirectories called Debug and Release, respectively, at that location. Note these locations; they will become important in the next section. The source code for PostgreSQL can be obtained from http://postgresql.org/download/ Select a recent version of postgres and download the corrresponding .tar.gz or .tar.bz2 archive for that version. Unpack the sources to some directory on your computer. Select "Visual Studio Command Prompt" from the Start menu. Alternatively, open a Command Prompt window and run: VCVARSALL.BAT amd64 to prepare the environment. From the Command Prompt window, "cd" into the postgres source tree directory, and run: nmake /f win32.mak You'll also want to build a Debug-flavour libpq, so then run: nmake /f win32.mak DEBUG=1 The libpq binaries will be produced in src/interfaces/libpq/Release and src/interface/libpq/Debug, respecitively, and the Debug versions will have an extra "D" in their names. (Instructions for building PostgreSQL with MinGW are given in the MSYS section below). Preparing to Compile libpqxx ---------------------------- The rest of this text will assume that you have the libpq library in its binary form(s), as well as its header files. Now, to work on building libpqxx! You'll need to provide certain common settings: i) Copy the file `win32/common-sample` to `win32/common`, and edit the latter to reflect the paths to your PostgreSQL includes and library files: - If you compiled PostgreSQL for yourself to obtain libpq, set PGSQLSRC in win32/common to point to the "src" subdirectory in your PostgreSQL source tree. - If you installed libpq using the One Click Installer, verify that PGSQLSRC points to your specific installation of PostgreSQL. Then follow the instructions in `win32/common`. - If you obtained libpq in any other way, you may be able to build libpqxx by making the appropriate adjustments to the `common` file. ii) Create the configuration headers: `include/pqxx/config-*-*.h`. The easiest start for this is to copy from available samples. In `config/sample-headers`, find the directories most closely matching your compiler and libpq version, respectively. Take the `config-*-*.h` headers from those directories and copy them into the `include/pqxx/` directory. On a Unix-like system these headers would be generated automatically by the configure script; in the Windows case they may need some editing. How these files work is described in more detail below. iii) If you are building libpqxx from a development source tree rather than from a release distribution, you may not have the makefiles for your compiler. These makefiles should be in the `win32` directory and have names ending in ".mak": "mingw.mak," "vc-libpqxx.mak," "vc-test.mak," and so on. If you don't have these files but you do have a python interpreter, you can generate them using the template2mak.py script in the tools directory: tools/template2mak.py win32/mingw.mak.template win32/mingw.mak tools/template2mak.py win32/vc-libpqxx.mak.template win32/vc-libpqxx.mak tools/template2mak.py win32/vc-test.mak.template win32/vc-test.mak tools/template2mak.py win32/vc-test-unit.mak.template win32/vc-test-unit.mak Building libpqxx ---------------- The rest of the procedure depends on your compiler. If you're using Visual C++: 1) Select Visual Studio Command Prompt from the Start menu. Alternatively, open a Command Prompt window and run VCVARSALL.BAT amd64 to prepare the environment. Then CD into the main directory of the libpqxx source tree. Among other things it will contain the files "configure" and "Makefile.am," and subdirectories "src," "include," "win32" etc. 2) Run: "nmake /f win32/vc-libpqxx.mak ALL" to compile all dynamic, static, debug and release libraries. Once completed, you will find them in these libraries in the lib directory. The build script also copies the libpq dlls and stub libraries to the lib directory. You will have to link with these files when building applications that use libpqxx clases and methods. 3) Your version of the libpq DLL may require other DLLs in order to execute. If you installed libpq with the one click installer, these DLLs can be found in the same folder as libpq itself. The exact set of DLLs varies depending on the version of PostgreSQL that you installed. For the 9.1 version of the One Click Installer, they were: `libeay32.dll`, `libiconv-2.dll`, `libintl-8.dll`, and `ssleay32.dll`. 4) Once you have identified any additional DLLs, you should copy them to another location (perhaps the libpqxx lib folder). 5) At this point, you will no longer need to keep the postgres sources or binaries on your computer to build applications with libpqxx. If you're using MinGW (but without a Unix-like environment, see above): 1) Run `mingw32-make -f win32/MinGW.mak` 2) Consider installing a Unix-like environment like MSYS to automate all this! Running the test suite ---------------------- After building libpqxx, it is recommended that you compile and run the self-test programs included in the package. Unix, Cygwin, or MSYS users simply type "make check" to build and run the entire regression test. For Visual C++ users, the following steps should accomplish the same: 1) To build all of the self-test configurations, run: nmake /f win32\vc-test.mak ALL nmake /f win32\vc-test.mak ALL DEBUG=1 nmake /f win32\vc-test.mak ALL DLL=1 nmake /f win32\vc-test.mak ALL DLL=1 DEBUG=1 This will create four new directories: TestStaticDebug, TestStaticRelease, TestDllDebug, and TestDllRelease. Each of these folders will contain the program "runner.exe," as well as any required DLLs. 2) Make sure a PostgreSQL database is running and accessible, and set up the environment variables PGDATABASE, PGHOST, PGPORT, and PGUSER as described in the libpqxx README.md file so the test program can connect without needing to pass a connection string. 3) Run runner.exe from any of the test directories. When runner.exe runs, it executes each of the test programs in order. Some of the tests will produce lots of output, some won't produce any. Error messages that are expected in the course of a normal test run are prefixed with "(Expected)" to show that they are not harmful. All tests should complete successfully. Running the unit tests ---------------------- You may also want to compile and run the unit test programs included in the package. The procedure for doing so for Visual Studio users is nearly identical to the procedure for running the main test suite, except for the name of the .mak file, which is `win32\vc-unit.mak`. The output build directories are UnitStaticDebug, UnitStaticRelease, UnitDllDebug, and UnitDllRelease. The test application name is again runner.exe. All of these tests should complete successfully as well. Setting Up a Visual Studio Project ---------------------------------- Here's how to set up a Visual C++ project file for your own program using libpqxx (based on description by Alexandre Hanft, 2006-03-06): 1) Create a new project in the Visual C++ development environment. 2) Add your first C++ file and provide some initial code, e.g. by copying the example from the libpqxx home page. 3) Edit Project Properties, C++: Additional Include Directories. Add the location of the "include" directory found in your libpqxx source tree, e.g. `C:\src\libpqxx\include` if you keep libpqxx in `C:\src\libpqxx`. 4) Edit Project Properties, Linker: Additional Library Directories. Add the directory where your libpq and libpqxx libraries are, for example: `C:\src\libpqxx\lib` 5) Edit Project Properties, Linker, Input: Additional Dependencies. Add: libpqxx.lib. That is for your Release build. Do the same for your Debug build, but replace that "libpqxx.lib" in there with "libpqxxD.lib". 6) Your program should build successfully now. It may not be ready to run yet, because some dynamically loaded libraries are needed when starting your program. Copy the necessary libpq and libpqxx DLLs from the lib directory in your libpqxx tree, directly into your project's build directory so the system can find them when your development environment launches your program. 7) Your program should now be able to run. However, you may need to tell it how to connect to a database. If you set the environment variables PGDATABASE, PGHOST, PGPORT, and PGUSER as described in the libpqxx README.md file, your program should be able to connect without passing further parameters. 8) Once your program gets to the point where users should be able to configure it properly, change it to pass a connection string where it connects to any databases, and include your user's configuration settings. A typical connection string setting all parameters named above might look like: "dbname=testbase user=testuser host=my.dbserver.somewhere.com" 9) For any other problems, please check the project homepage as listed in the main libpqxx README.md file. Getting Started with MinGW and MSYS ----------------------------------- (Based on contribution by Michael J. Pedersen, 2004-08-17) MSYS is a Unix-like environment for Windows. Once you have this installed, building libpqxx should be a lot more like it is under Unix except that the locations of libraries and such aren't sufficiently standardized. Packages to download if you don't have them already: 1) MinGW (http://www.mingw.org/). 2) MSYS (http://www.mingw.org/). 3) w32api (http://www.mingw.org/). 4) PostgreSQL (http://www.postgresql.org/). 5) zlib (http://www.zlib.org/). It is generally recommended to get the latest versions of these packages. Compiling and installing PostgreSQL before you get to libpqxx: 1) Install MinGW (install to `c:\mingw`) 2) Install MSYS -- but not into the MinGW directory tree! 3) Run MSYS (Start -> Programs -> MinGW -> MSYS -> msys) 4) Extract, compile, and install zlib # From the main source directory of zlib: ./configure --prefix=c:/mingw/local && make && make install 5) Extract, compile, and install postgres # From the main source directory of PostgreSQL: ./configure --prefix=c:/mingw/local --with-includes=c:/mingw/local/include --with-libs=c:/mingw/local/lib make && make install 6) Extract, compile, and install libpqxx export lDFLAGS=-lws2_32 ./configure --prefix=c:/mingw/local --enable-static make && make install If you don't have and don't want to install MSYS, you won't be able to perform the "./configure" step. You can build libpqxx without it, but it takes a bit more work and doesn't build the self-test. Use the special makefile MinGW.mak in the win32 directory instead of the regular Makefile, and follow the procedure described below to use the prefabricated configuration headers enclosed in the source archive. Building libpqxx without MSYS ----------------------------- # (First set up configuration headers, see below) export LDFLAGS=-lws2_32 make -f win32/MinGW.mak # (Also install library, headers, and pkg-config on your system) Having installed libpqxx, when compiling your own programs, use the following steps (examples only here): g++ -c -o myfile.o myfile.cpp `pkg-config libpqxx --cflags` g++ -o myexec myfile.o `pkg-config libpqxx --libs` -lws2_32 Note that the linker step (g++ -o myexec) will give a spurious warning about not knowing how to use the -R flag, but the executable will still be generated, and work just fine. The last argument to that linker step MUST be `-lws2_32`. Without it, the link will provide errors about undefined references to select(). If it's not the last argument, you will get the same results. Make sure it's there, and make sure it's last. Trust me, you'll be happier. Setting up the configuration headers ------------------------------------ Several headers, normally generated by the configure script, define certain aspects of your compilation environment so that the library can work around compiler shortcomings, functions missing in older libpq versions, etc. (Samples for various compiler and libpq versions can be found in the subdirectory config/sample-headers, so if you find you need to provide these headers yourself, look there first.) Each of the aspects mentioned below is represented by a configuration item -- a preprocessor macro that is either #define'd to some value or not defined at all. Most of the items are of a Boolean nature, i.e. some feature or workaround is enabled if the corresponding macro is defined, or disabled if the macro is left undefined. Note that defining these macros to anything at all, even 0, means that the corresponding option is _enabled_. At the time of writing, there are 2 of these configuration headers that you need to concern yourself about, both of which should be created in the include/pqxx subdirectory: config-internal-compiler.h config-public-compiler.h The names contain two variables: 1. Internal or public. Configuration items that affect the compilation of your client program are located in the config-public-*.h files (currently only one file); ones that affect only the compilation of the library itself are kept in the config-internal-*.h ones and are not included at all when compiling client programs. Public configuration items are prefixed with PQXX_ to avoid clashes with macros defined by other code. 2. Autotools-related, compiler-related, or libpq-related. The autotools items are of no real interest, and the libpq section is currently empty, but the compiler one is different. The compiler-related items describe features and shortcomings of the compiler environment, such as the availability of particular headers or definitions, or the ability to compile C++ language constructs that aren't always available. The libpq items (none at the time of writing) describe what features are available in the version of libpq you're compiling against. A complete list of configuration items and their categorizations can be found in the configitems file. The normal configure script reads the list of items from include/pqxx/config.h.in and writes them to include/pqxx/config.h, then splits them up into the five smaller files as directed by the configitems database. Again, sample versions of these headers for various environments can be found in the config/sample-headers/ directory. Try copying the ones that most resemble your own environment into include/pqxx/ and, if you have any problems compiling with those, editing them by hand to enable or disable features that appear to be giving you trouble. Shared and Static Libraries, or .DLL vs. .LIB --------------------------------------------- There are two ways to build the libpqxx library: as a shared library (known in the Unix world as a Shared Object or "so," but in the Windows world as a Dynamically Loaded Library or DLL) or as a static library (whose name would end in ".a" on Unix systems but in ".LIB" on Windows systems). Linking your own applications to these types of libraries is quite similar, except with a DLL the system will also have to be able to find the library when your program is loaded--not just when you are compiling it. Unlike the situation in the Unix world, however, your choice on this point must be known as you compile your application code. With libpqxx you do this by defining the preprocessor macro PQXX_SHARED when compiling your code for use with a libpqxx DLL. Leave this definition out if you intend to link to the static version of the library. (Internally, when compiling libpqxx, this variable will also be set according to which kind of library is being built. It has a slightly different meaning in that case, but this should really only matter to you if you are helping debug the library) Similarly, you may choose to link to either the static or the shared version of libpq. The default is to use the dynamic library, which makes more sense there because libpq's API and ABI are much simpler and more stable. To build a libpqxx for use with a static libpq, however, define the preprocessor symbol PQXX_PQ_STATIC both when compiling libpqxx and while building your own application. Troubleshooting: config headers ------------------------------- The biggest typical problem for Windows/VC++ users is the need to edit the configuration headers manually, resulting usually in compile errors, e.g. for missing header files. Thus, if you get a compile error, the first places to look are the config-*-*.h and config-*-*.h files in include/pqxx. If, for instance, the error states that the header file is missing, you will find a configuration variable called PQXX_HAVE_SYS_SELECT_H, which should not be set if your system doesn't have sys/select.h. Remove the line defining this variable from the configuration header where it is defined (see the configitems file for a list of locations) and the error should disappear on the next compilation attempt. If you have to edit your configuration headers, please send your results on Github, so that headers corresponding to your environment can be included in later libpqxx releases. CAUTION: DO NOT try to unset yes/no configuration items by defining their macros to zero. A value of zero counts as "yes." If a macro is defined at all, that means "yes" (or "true," or "enabled" etc.) regardless of what actual value you set. To disable an item, make sure it is not defined at all. Troubleshooting: linking ------------------------ When you link your application to libpqxx on Windows, you may also need to link to ws2_32.lib. On Visual C++, add these in the compiler user interface under: Project Properties::Linker::Input::Additional Dependencies We recommend that you specify libpqxx_static.lib and ws2_32.lib there, in that order. libpqxx-6.4.5/win32/Makefile.am000066400000000000000000000003451350065432700162220ustar00rootroot00000000000000EXTRA_DIST = \ common-sample \ INSTALL.txt \ libpqxx.cxx \ MinGW.mak.template \ MinGW.mak \ vc-libpqxx.mak.template \ vc-libpqxx.mak \ vc-test.mak.template \ vc-test.mak \ vc-test-unit.mak.template \ vc-test-unit.mak libpqxx-6.4.5/win32/Makefile.in000066400000000000000000000307761350065432700162460ustar00rootroot00000000000000# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = win32 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \ $(top_srcdir)/config/m4/ltoptions.m4 \ $(top_srcdir)/config/m4/ltsugar.m4 \ $(top_srcdir)/config/m4/ltversion.m4 \ $(top_srcdir)/config/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/pqxx/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/config/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR = @MKDIR@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PG_CONFIG = @PG_CONFIG@ PKG_CONFIG = @PKG_CONFIG@ POSTGRES_INCLUDE = @POSTGRES_INCLUDE@ POSTGRES_LIB = @POSTGRES_LIB@ PQXXVERSION = @PQXXVERSION@ PQXX_ABI = @PQXX_ABI@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_postgres_include = @with_postgres_include@ with_postgres_lib = @with_postgres_lib@ EXTRA_DIST = \ common-sample \ INSTALL.txt \ libpqxx.cxx \ MinGW.mak.template \ MinGW.mak \ vc-libpqxx.mak.template \ vc-libpqxx.mak \ vc-test.mak.template \ vc-test.mak \ vc-test-unit.mak.template \ vc-test-unit.mak all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu win32/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu win32/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: libpqxx-6.4.5/win32/MinGW.mak000066400000000000000000000131541350065432700156430ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './win32/MinGW.mak.template'. ################################################################################ # MinGW makefile for libpqxx. Don't use this; use the configure script instead! # Based on original contributed by Pasquale Fersini include win32/common CXX = g++.exe OBJ = \ src/array.o \ src/binarystring.o \ src/connection.o \ src/connection_base.o \ src/cursor.o \ src/dbtransaction.o \ src/encodings.o \ src/errorhandler.o \ src/except.o \ src/field.o \ src/largeobject.o \ src/nontransaction.o \ src/notification.o \ src/pipeline.o \ src/prepared_statement.o \ src/result.o \ src/robusttransaction.o \ src/row.o \ src/sql_cursor.o \ src/statement_parameters.o \ src/strconv.o \ src/stream_base.o \ src/stream_from.o \ src/stream_to.o \ src/subtransaction.o \ src/tablereader.o \ src/tablestream.o \ src/tablewriter.o \ src/transaction.o \ src/transaction_base.o \ src/util.o \ src/version.o \ LDFLAGS = -L$(LIBPQPATH) --export-all-symbols --add-stdcall-alias -fpic LIBS = -lpq -lm -lws2_32 CPPFLAGS = -Iinclude -I$(PGSQLINC) -I$(LIBPQINC) \ -DBUILDING_DLL -DPQXX_SHARED BIN = libpqxx.dll .PHONY: all clean all: libpqxx.dll clean: rm -f $(OBJ) $(BIN) DLLWRAP=dllwrap.exe DEFFILE=libpqxx.def STATICLIB=libpqxx.a $(BIN): $(OBJ) $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(OBJ) $(LDFLAGS) $(LIBS) -o $(BIN) src/array.o: src/array.cxx $(CXX) $(CPPFLAGS) -c src/array.cxx -o src/array.o $(CXXFLAGS) src/binarystring.o: src/binarystring.cxx $(CXX) $(CPPFLAGS) -c src/binarystring.cxx -o src/binarystring.o $(CXXFLAGS) src/connection.o: src/connection.cxx $(CXX) $(CPPFLAGS) -c src/connection.cxx -o src/connection.o $(CXXFLAGS) src/connection_base.o: src/connection_base.cxx $(CXX) $(CPPFLAGS) -c src/connection_base.cxx -o src/connection_base.o $(CXXFLAGS) src/cursor.o: src/cursor.cxx $(CXX) $(CPPFLAGS) -c src/cursor.cxx -o src/cursor.o $(CXXFLAGS) src/dbtransaction.o: src/dbtransaction.cxx $(CXX) $(CPPFLAGS) -c src/dbtransaction.cxx -o src/dbtransaction.o $(CXXFLAGS) src/encodings.o: src/encodings.cxx $(CXX) $(CPPFLAGS) -c src/encodings.cxx -o src/encodings.o $(CXXFLAGS) src/errorhandler.o: src/errorhandler.cxx $(CXX) $(CPPFLAGS) -c src/errorhandler.cxx -o src/errorhandler.o $(CXXFLAGS) src/except.o: src/except.cxx $(CXX) $(CPPFLAGS) -c src/except.cxx -o src/except.o $(CXXFLAGS) src/field.o: src/field.cxx $(CXX) $(CPPFLAGS) -c src/field.cxx -o src/field.o $(CXXFLAGS) src/largeobject.o: src/largeobject.cxx $(CXX) $(CPPFLAGS) -c src/largeobject.cxx -o src/largeobject.o $(CXXFLAGS) src/nontransaction.o: src/nontransaction.cxx $(CXX) $(CPPFLAGS) -c src/nontransaction.cxx -o src/nontransaction.o $(CXXFLAGS) src/notification.o: src/notification.cxx $(CXX) $(CPPFLAGS) -c src/notification.cxx -o src/notification.o $(CXXFLAGS) src/pipeline.o: src/pipeline.cxx $(CXX) $(CPPFLAGS) -c src/pipeline.cxx -o src/pipeline.o $(CXXFLAGS) src/prepared_statement.o: src/prepared_statement.cxx $(CXX) $(CPPFLAGS) -c src/prepared_statement.cxx -o src/prepared_statement.o $(CXXFLAGS) src/result.o: src/result.cxx $(CXX) $(CPPFLAGS) -c src/result.cxx -o src/result.o $(CXXFLAGS) src/robusttransaction.o: src/robusttransaction.cxx $(CXX) $(CPPFLAGS) -c src/robusttransaction.cxx -o src/robusttransaction.o $(CXXFLAGS) src/row.o: src/row.cxx $(CXX) $(CPPFLAGS) -c src/row.cxx -o src/row.o $(CXXFLAGS) src/sql_cursor.o: src/sql_cursor.cxx $(CXX) $(CPPFLAGS) -c src/sql_cursor.cxx -o src/sql_cursor.o $(CXXFLAGS) src/statement_parameters.o: src/statement_parameters.cxx $(CXX) $(CPPFLAGS) -c src/statement_parameters.cxx -o src/statement_parameters.o $(CXXFLAGS) src/strconv.o: src/strconv.cxx $(CXX) $(CPPFLAGS) -c src/strconv.cxx -o src/strconv.o $(CXXFLAGS) src/stream_base.o: src/stream_base.cxx $(CXX) $(CPPFLAGS) -c src/stream_base.cxx -o src/stream_base.o $(CXXFLAGS) src/stream_from.o: src/stream_from.cxx $(CXX) $(CPPFLAGS) -c src/stream_from.cxx -o src/stream_from.o $(CXXFLAGS) src/stream_to.o: src/stream_to.cxx $(CXX) $(CPPFLAGS) -c src/stream_to.cxx -o src/stream_to.o $(CXXFLAGS) src/subtransaction.o: src/subtransaction.cxx $(CXX) $(CPPFLAGS) -c src/subtransaction.cxx -o src/subtransaction.o $(CXXFLAGS) src/tablereader.o: src/tablereader.cxx $(CXX) $(CPPFLAGS) -c src/tablereader.cxx -o src/tablereader.o $(CXXFLAGS) src/tablestream.o: src/tablestream.cxx $(CXX) $(CPPFLAGS) -c src/tablestream.cxx -o src/tablestream.o $(CXXFLAGS) src/tablewriter.o: src/tablewriter.cxx $(CXX) $(CPPFLAGS) -c src/tablewriter.cxx -o src/tablewriter.o $(CXXFLAGS) src/transaction.o: src/transaction.cxx $(CXX) $(CPPFLAGS) -c src/transaction.cxx -o src/transaction.o $(CXXFLAGS) src/transaction_base.o: src/transaction_base.cxx $(CXX) $(CPPFLAGS) -c src/transaction_base.cxx -o src/transaction_base.o $(CXXFLAGS) src/util.o: src/util.cxx $(CXX) $(CPPFLAGS) -c src/util.cxx -o src/util.o $(CXXFLAGS) src/version.o: src/version.cxx $(CXX) $(CPPFLAGS) -c src/version.cxx -o src/version.o $(CXXFLAGS) libpqxx-6.4.5/win32/MinGW.mak.template000066400000000000000000000016511350065432700174540ustar00rootroot00000000000000# MinGW makefile for libpqxx. Don't use this; use the configure script instead! # Based on original contributed by Pasquale Fersini include win32/common CXX = g++.exe OBJ = \ ###MAKTEMPLATE:FOREACH src/*.cxx src/###BASENAME###.o \ ###MAKTEMPLATE:ENDFOREACH LDFLAGS = -L$(LIBPQPATH) --export-all-symbols --add-stdcall-alias -fpic LIBS = -lpq -lm -lws2_32 CPPFLAGS = -Iinclude -I$(PGSQLINC) -I$(LIBPQINC) \ -DBUILDING_DLL -DPQXX_SHARED BIN = libpqxx.dll .PHONY: all clean all: libpqxx.dll clean: rm -f $(OBJ) $(BIN) DLLWRAP=dllwrap.exe DEFFILE=libpqxx.def STATICLIB=libpqxx.a $(BIN): $(OBJ) $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(OBJ) $(LDFLAGS) $(LIBS) -o $(BIN) ###MAKTEMPLATE:FOREACH src/*.cxx src/###BASENAME###.o: src/###BASENAME###.cxx $(CXX) $(CPPFLAGS) -c src/###BASENAME###.cxx -o src/###BASENAME###.o $(CXXFLAGS) ###MAKTEMPLATE:ENDFOREACH libpqxx-6.4.5/win32/common-sample000066400000000000000000000046461350065432700166700ustar00rootroot00000000000000# Common options for Visual C++ makefiles to build libpqxx and its regression # test. # # THE ORIGINAL OF THIS FILE IS CALLED common-sample; DON'T EDIT THE ORIGINAL or # you may lose your changes when you upgrade your libpqxx sources. # Instead, copy "common-sample" to "common" and edit just the file "common". # Caution: on Windows, some environments, such as the "make" that comes with # Visual C++, expect you to use backslashes as path separators (for example, # "C:\src\libpqxx") whereas others like MinGW want you to use slashes (as in # "C:/src/libpqxx"). # PGSQLSRC tells us the directory under which all PostgreSQL include # directories, DLLs and LIB files can be found. # # Edit this to suit your installation. PGSQLSRC=C:\Sources\postgresql-9.1.1\src # Directory where the Postgres header files, e.g. postgres_ext.h, are found. # # You shouldn't normally need to edit this; the default is to take them from # the PGSQLSRC directory. PGSQLINC=$(PGSQLSRC)\include # Directory where the libpq header files, e.g. libpq-fe.h, are found. If you # used the One Click Installer, comment out the next line and uncomment the # one following it: LIBPQINC=$(PGSQLSRC)\interfaces\libpq #LIBPQINC=$(PGSQLSRC)\include # Directory where the release build of the libpq DLL and its corresponding LIB # file are found, as well as the names of those two files. # # If you installed PostgreSQL using the One Click Installer from EnterpriseDB, # comment out the next three lines and uncomment the following three. # # If you are using MinGW, remove the "Release" part from LIBPQPATH. LIBPQPATH=$(PGSQLSRC)\interfaces\libpq\Release LIBPQDLL=libpq.dll LIBPQLIB=libpqdll.lib #LIBPQPATH=$(PGSQLSRC)\lib #LIBPQDLL=libpq.dll #LIBPQLIB=libpq.lib # Directory where the debug build of the libpq DLL and its corresponding LIB # file are found, as well as the names of those two files. # # If you don't have access to a debug build of libpq, just provide the same # information as above here. The debug builds of libpqxx will reference the # release version of libpq, which will limit your ability to debug libpq # sources but otherwise should work just fine. # # If you installed PostgreSQL using the One Click Installer from EnterpriseDB, # comment out the next three lines and uncomment the following three. LIBPQDPATH=$(PGSQLSRC)\interfaces\libpq\Debug LIBPQDDLL=libpqd.dll LIBPQDLIB=libpqddll.lib #LIBPQDPATH=$(PGSQLSRC)\lib #LIBPQDDLL=libpq.dll #LIBPQDLIB=libpq.lib libpqxx-6.4.5/win32/libpqxx.cxx000066400000000000000000000003541350065432700164010ustar00rootroot00000000000000// libpqxx.cxx : Defines the entry point for the DLL application. #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include BOOL APIENTRY DllMain(HANDLE, DWORD, LPVOID) { return TRUE; } libpqxx-6.4.5/win32/vc-libpqxx.mak000066400000000000000000001130361350065432700167570ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './win32/vc-libpqxx.mak.template'. ################################################################################ # Visual C++ makefile for libpqxx # This file was created by Bart Samwel. default: @echo LIBPQXX Makefile for Visual C++ Available Targets @echo ------------------------------------------------- @echo. @echo Static library targets: @echo. @echo STATIC @echo STATICRELEASE (release mode only) @echo STATICDEBUG (debug mode only) @echo. @echo Dynamic Link Library (DLL) targets: @echo. @echo DLL @echo DLLRELEASE @echo DLLDEBUG @echo. @echo Other targets: @echo. @echo ALL: build both the DLL and STATIC builds. @echo CLEAN: clean up all output. @echo. @echo It is recommended that you link to libpqxx statically. Therefore, you should @echo normally build the "STATIC" target. If you want to link your programto libpqxx @echo dynamically, build target "DLL" and compile your program with preprocessor @echo define "PQXX_SHARED". This will make your program link against the DLL version @echo of libpqxx. !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF !include win32/common ######################################################## # Configuration ######################################################## # Output DLL/LIB files. No extensions, they are added automatically! OUTDIR=lib OUTFILE_STATICDEBUG=$(OUTDIR)\libpqxx_staticD OUTFILE_STATICRELEASE=$(OUTDIR)\libpqxx_static OUTFILE_DLLDEBUG=$(OUTDIR)\libpqxxD OUTFILE_DLLRELEASE=$(OUTDIR)\libpqxx # Directories for intermediate output. INTDIR_STATICDEBUG=ObjStaticDebug INTDIR_STATICRELEASE=ObjStaticRelease INTDIR_DLLDEBUG=ObjDllDebug INTDIR_DLLRELEASE=ObjDllRelease # C++ compiler, linker (for DLLs) and library tool (for static builds). CXX=cl.exe LINK=link.exe LIBTOOL=link.exe -lib # The options common to all the different builds. CXX_FLAGS_BASE=/nologo /W3 /EHsc /FD /GR /c \ /I "include" /I $(PGSQLINC) /I $(LIBPQINC) \ /D "WIN32" /D "_MBCS" /D "_WINDOWS" /D "PQXX_INTERNAL" /D "NOMINMAX" CXX_FLAGS_DLLRELEASE=$(CXX_FLAGS_BASE) /MD /D "NDEBUG" /D "PQXX_SHARED" CXX_FLAGS_DLLDEBUG=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_DEBUG" /D "PQXX_SHARED" /RTC1 CXX_FLAGS_STATICRELEASE=$(CXX_FLAGS_BASE) /MD /D "_LIB" /D "NDEBUG" CXX_FLAGS_STATICDEBUG=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_LIB" /D "_DEBUG" /RTC1 LINK_FLAGS_BASE=kernel32.lib ws2_32.lib advapi32.lib /nologo /dll shell32.lib secur32.lib wldap32.lib LINK_FLAGS_DLLRELEASE=$(LINK_FLAGS_BASE) /libpath:$(LIBPQPATH) $(LIBPQLIB) LINK_FLAGS_DLLDEBUG=$(LINK_FLAGS_BASE) /libpath:$(LIBPQDPATH) $(LIBPQDLIB) /debug LIB_FLAGS=/nologo ######################################################## # List of intermediate files ######################################################## OBJ_STATICDEBUG=\ "$(INTDIR_STATICDEBUG)\array.obj" \ "$(INTDIR_STATICDEBUG)\binarystring.obj" \ "$(INTDIR_STATICDEBUG)\connection.obj" \ "$(INTDIR_STATICDEBUG)\connection_base.obj" \ "$(INTDIR_STATICDEBUG)\cursor.obj" \ "$(INTDIR_STATICDEBUG)\dbtransaction.obj" \ "$(INTDIR_STATICDEBUG)\encodings.obj" \ "$(INTDIR_STATICDEBUG)\errorhandler.obj" \ "$(INTDIR_STATICDEBUG)\except.obj" \ "$(INTDIR_STATICDEBUG)\field.obj" \ "$(INTDIR_STATICDEBUG)\largeobject.obj" \ "$(INTDIR_STATICDEBUG)\nontransaction.obj" \ "$(INTDIR_STATICDEBUG)\notification.obj" \ "$(INTDIR_STATICDEBUG)\pipeline.obj" \ "$(INTDIR_STATICDEBUG)\prepared_statement.obj" \ "$(INTDIR_STATICDEBUG)\result.obj" \ "$(INTDIR_STATICDEBUG)\robusttransaction.obj" \ "$(INTDIR_STATICDEBUG)\row.obj" \ "$(INTDIR_STATICDEBUG)\sql_cursor.obj" \ "$(INTDIR_STATICDEBUG)\statement_parameters.obj" \ "$(INTDIR_STATICDEBUG)\strconv.obj" \ "$(INTDIR_STATICDEBUG)\stream_base.obj" \ "$(INTDIR_STATICDEBUG)\stream_from.obj" \ "$(INTDIR_STATICDEBUG)\stream_to.obj" \ "$(INTDIR_STATICDEBUG)\subtransaction.obj" \ "$(INTDIR_STATICDEBUG)\tablereader.obj" \ "$(INTDIR_STATICDEBUG)\tablestream.obj" \ "$(INTDIR_STATICDEBUG)\tablewriter.obj" \ "$(INTDIR_STATICDEBUG)\transaction.obj" \ "$(INTDIR_STATICDEBUG)\transaction_base.obj" \ "$(INTDIR_STATICDEBUG)\util.obj" \ "$(INTDIR_STATICDEBUG)\version.obj" \ OBJ_STATICRELEASE=\ "$(INTDIR_STATICRELEASE)\array.obj" \ "$(INTDIR_STATICRELEASE)\binarystring.obj" \ "$(INTDIR_STATICRELEASE)\connection.obj" \ "$(INTDIR_STATICRELEASE)\connection_base.obj" \ "$(INTDIR_STATICRELEASE)\cursor.obj" \ "$(INTDIR_STATICRELEASE)\dbtransaction.obj" \ "$(INTDIR_STATICRELEASE)\encodings.obj" \ "$(INTDIR_STATICRELEASE)\errorhandler.obj" \ "$(INTDIR_STATICRELEASE)\except.obj" \ "$(INTDIR_STATICRELEASE)\field.obj" \ "$(INTDIR_STATICRELEASE)\largeobject.obj" \ "$(INTDIR_STATICRELEASE)\nontransaction.obj" \ "$(INTDIR_STATICRELEASE)\notification.obj" \ "$(INTDIR_STATICRELEASE)\pipeline.obj" \ "$(INTDIR_STATICRELEASE)\prepared_statement.obj" \ "$(INTDIR_STATICRELEASE)\result.obj" \ "$(INTDIR_STATICRELEASE)\robusttransaction.obj" \ "$(INTDIR_STATICRELEASE)\row.obj" \ "$(INTDIR_STATICRELEASE)\sql_cursor.obj" \ "$(INTDIR_STATICRELEASE)\statement_parameters.obj" \ "$(INTDIR_STATICRELEASE)\strconv.obj" \ "$(INTDIR_STATICRELEASE)\stream_base.obj" \ "$(INTDIR_STATICRELEASE)\stream_from.obj" \ "$(INTDIR_STATICRELEASE)\stream_to.obj" \ "$(INTDIR_STATICRELEASE)\subtransaction.obj" \ "$(INTDIR_STATICRELEASE)\tablereader.obj" \ "$(INTDIR_STATICRELEASE)\tablestream.obj" \ "$(INTDIR_STATICRELEASE)\tablewriter.obj" \ "$(INTDIR_STATICRELEASE)\transaction.obj" \ "$(INTDIR_STATICRELEASE)\transaction_base.obj" \ "$(INTDIR_STATICRELEASE)\util.obj" \ "$(INTDIR_STATICRELEASE)\version.obj" \ OBJ_DLLDEBUG=\ "$(INTDIR_DLLDEBUG)\array.obj" \ "$(INTDIR_DLLDEBUG)\binarystring.obj" \ "$(INTDIR_DLLDEBUG)\connection.obj" \ "$(INTDIR_DLLDEBUG)\connection_base.obj" \ "$(INTDIR_DLLDEBUG)\cursor.obj" \ "$(INTDIR_DLLDEBUG)\dbtransaction.obj" \ "$(INTDIR_DLLDEBUG)\encodings.obj" \ "$(INTDIR_DLLDEBUG)\errorhandler.obj" \ "$(INTDIR_DLLDEBUG)\except.obj" \ "$(INTDIR_DLLDEBUG)\field.obj" \ "$(INTDIR_DLLDEBUG)\largeobject.obj" \ "$(INTDIR_DLLDEBUG)\nontransaction.obj" \ "$(INTDIR_DLLDEBUG)\notification.obj" \ "$(INTDIR_DLLDEBUG)\pipeline.obj" \ "$(INTDIR_DLLDEBUG)\prepared_statement.obj" \ "$(INTDIR_DLLDEBUG)\result.obj" \ "$(INTDIR_DLLDEBUG)\robusttransaction.obj" \ "$(INTDIR_DLLDEBUG)\row.obj" \ "$(INTDIR_DLLDEBUG)\sql_cursor.obj" \ "$(INTDIR_DLLDEBUG)\statement_parameters.obj" \ "$(INTDIR_DLLDEBUG)\strconv.obj" \ "$(INTDIR_DLLDEBUG)\stream_base.obj" \ "$(INTDIR_DLLDEBUG)\stream_from.obj" \ "$(INTDIR_DLLDEBUG)\stream_to.obj" \ "$(INTDIR_DLLDEBUG)\subtransaction.obj" \ "$(INTDIR_DLLDEBUG)\tablereader.obj" \ "$(INTDIR_DLLDEBUG)\tablestream.obj" \ "$(INTDIR_DLLDEBUG)\tablewriter.obj" \ "$(INTDIR_DLLDEBUG)\transaction.obj" \ "$(INTDIR_DLLDEBUG)\transaction_base.obj" \ "$(INTDIR_DLLDEBUG)\util.obj" \ "$(INTDIR_DLLDEBUG)\version.obj" \ "$(INTDIR_DLLDEBUG)\libpqxx.obj" \ OBJ_DLLRELEASE=\ "$(INTDIR_DLLRELEASE)\array.obj" \ "$(INTDIR_DLLRELEASE)\binarystring.obj" \ "$(INTDIR_DLLRELEASE)\connection.obj" \ "$(INTDIR_DLLRELEASE)\connection_base.obj" \ "$(INTDIR_DLLRELEASE)\cursor.obj" \ "$(INTDIR_DLLRELEASE)\dbtransaction.obj" \ "$(INTDIR_DLLRELEASE)\encodings.obj" \ "$(INTDIR_DLLRELEASE)\errorhandler.obj" \ "$(INTDIR_DLLRELEASE)\except.obj" \ "$(INTDIR_DLLRELEASE)\field.obj" \ "$(INTDIR_DLLRELEASE)\largeobject.obj" \ "$(INTDIR_DLLRELEASE)\nontransaction.obj" \ "$(INTDIR_DLLRELEASE)\notification.obj" \ "$(INTDIR_DLLRELEASE)\pipeline.obj" \ "$(INTDIR_DLLRELEASE)\prepared_statement.obj" \ "$(INTDIR_DLLRELEASE)\result.obj" \ "$(INTDIR_DLLRELEASE)\robusttransaction.obj" \ "$(INTDIR_DLLRELEASE)\row.obj" \ "$(INTDIR_DLLRELEASE)\sql_cursor.obj" \ "$(INTDIR_DLLRELEASE)\statement_parameters.obj" \ "$(INTDIR_DLLRELEASE)\strconv.obj" \ "$(INTDIR_DLLRELEASE)\stream_base.obj" \ "$(INTDIR_DLLRELEASE)\stream_from.obj" \ "$(INTDIR_DLLRELEASE)\stream_to.obj" \ "$(INTDIR_DLLRELEASE)\subtransaction.obj" \ "$(INTDIR_DLLRELEASE)\tablereader.obj" \ "$(INTDIR_DLLRELEASE)\tablestream.obj" \ "$(INTDIR_DLLRELEASE)\tablewriter.obj" \ "$(INTDIR_DLLRELEASE)\transaction.obj" \ "$(INTDIR_DLLRELEASE)\transaction_base.obj" \ "$(INTDIR_DLLRELEASE)\util.obj" \ "$(INTDIR_DLLRELEASE)\version.obj" \ "$(INTDIR_DLLRELEASE)\libpqxx.obj" \ ######################################################## # Logical targets ######################################################## static: staticdebug staticrelease dll: dlldebug dllrelease all: static dll $(OUTDIR): -@mkdir $(OUTDIR) staticdebug: $(OUTFILE_STATICDEBUG).lib $(OUTDIR) $(OUTDIR)\$(LIBPQDDLL) $(OUTDIR)\$(LIBPQDLIB) staticrelease: $(OUTFILE_STATICRELEASE).lib $(OUTDIR) $(OUTDIR)\$(LIBPQDLL) $(OUTDIR)\$(LIBPQLIB) dlldebug: $(OUTFILE_DLLDEBUG).dll $(OUTDIR) $(OUTDIR)\$(LIBPQDDLL) dllrelease: $(OUTFILE_DLLRELEASE).dll $(OUTDIR) $(OUTDIR)\$(LIBPQDLL) clean: @echo Deleting all intermediate output files and the contents of $(OUTDIR). -@del /Q "$(INTDIR_STATICDEBUG)\*" -@del /Q "$(INTDIR_STATICRELEASE)\*" -@del /Q "$(INTDIR_DLLDEBUG)\*" -@del /Q "$(INTDIR_DLLRELEASE)\*" -@del /Q "$(OUTDIR)\*" ######################################################## # Physical targets ######################################################## $(OUTDIR)\$(LIBPQDLL):: $(OUTDIR) @echo ------------------------------------------------------------- @echo Copying $(LIBPQDLL) to $(OUTDIR). @echo. @echo IMPORTANT: you MUST copy this $(LIBPQDLL) into the directory @echo where your program's .EXE resides. The system $(LIBPQDLL) is @echo not necessarily compatible with the libpq include files that @echo you built libpqxx with. Do NOT copy this file into your @echo Windows system32 directory, that may break other programs. @echo Instead, keep it with your program and distribute it along @echo with the program. @echo ------------------------------------------------------------- copy "$(LIBPQPATH)\$(LIBPQDLL)" "$(OUTDIR)" $(OUTDIR)\$(LIBPQDDLL):: $(OUTDIR) @echo ------------------------------------------------------------- @echo Copying $(LIBPQDDLL) to $(OUTDIR). @echo. @echo IMPORTANT: you MUST copy this $(LIBPQDDLL) into the directory @echo where your program's .EXE resides, or you must make sure that @echo it is in your system PATH. @echo ------------------------------------------------------------- copy "$(LIBPQDPATH)\$(LIBPQDDLL)" "$(OUTDIR)" $(OUTDIR)\$(LIBPQLIB):: $(OUTDIR) copy "$(LIBPQPATH)\$(LIBPQLIB)" "$(OUTDIR)" $(OUTDIR)\$(LIBPQDLIB):: $(OUTDIR) copy "$(LIBPQDPATH)\$(LIBPQDLIB)" "$(OUTDIR)" $(OUTFILE_STATICDEBUG).lib:: $(OUTDIR) $(OBJ_STATICDEBUG) $(LIBTOOL) $(LIB_FLAGS) $(OBJ_STATICDEBUG) /out:"$(OUTFILE_STATICDEBUG).lib" $(OUTFILE_STATICRELEASE).lib:: $(OUTDIR) $(OBJ_STATICRELEASE) $(LIBTOOL) $(LIB_FLAGS) $(OBJ_STATICRELEASE) /out:"$(OUTFILE_STATICRELEASE).lib" $(OUTFILE_DLLDEBUG).dll:: $(OUTDIR) $(OBJ_DLLDEBUG) $(LINK) $(LINK_FLAGS_DLLDEBUG) $(OBJ_DLLDEBUG) /out:"$(OUTFILE_DLLDEBUG).dll" /implib:"$(OUTFILE_DLLDEBUG).lib" $(OUTFILE_DLLRELEASE).dll:: $(OUTDIR) $(OBJ_DLLRELEASE) $(LINK) $(LINK_FLAGS_DLLRELEASE) $(OBJ_DLLRELEASE) /out:"$(OUTFILE_DLLRELEASE).dll" /implib:"$(OUTFILE_DLLRELEASE).lib" $(INTDIR_STATICDEBUG):: -@mkdir $(INTDIR_STATICDEBUG) $(INTDIR_STATICRELEASE):: -@mkdir $(INTDIR_STATICRELEASE) $(INTDIR_DLLDEBUG):: -@mkdir $(INTDIR_DLLDEBUG) $(INTDIR_DLLRELEASE):: -@mkdir $(INTDIR_DLLRELEASE) ######################################################## # Physical intermediate files ######################################################## "$(INTDIR_STATICRELEASE)\array.obj": src/array.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/array.cxx "$(INTDIR_STATICDEBUG)\array.obj": src/array.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/array.cxx "$(INTDIR_STATICRELEASE)\binarystring.obj": src/binarystring.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/binarystring.cxx "$(INTDIR_STATICDEBUG)\binarystring.obj": src/binarystring.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/binarystring.cxx "$(INTDIR_STATICRELEASE)\connection.obj": src/connection.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/connection.cxx "$(INTDIR_STATICDEBUG)\connection.obj": src/connection.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/connection.cxx "$(INTDIR_STATICRELEASE)\connection_base.obj": src/connection_base.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/connection_base.cxx "$(INTDIR_STATICDEBUG)\connection_base.obj": src/connection_base.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/connection_base.cxx "$(INTDIR_STATICRELEASE)\cursor.obj": src/cursor.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/cursor.cxx "$(INTDIR_STATICDEBUG)\cursor.obj": src/cursor.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/cursor.cxx "$(INTDIR_STATICRELEASE)\dbtransaction.obj": src/dbtransaction.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/dbtransaction.cxx "$(INTDIR_STATICDEBUG)\dbtransaction.obj": src/dbtransaction.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/dbtransaction.cxx "$(INTDIR_STATICRELEASE)\encodings.obj": src/encodings.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/encodings.cxx "$(INTDIR_STATICDEBUG)\encodings.obj": src/encodings.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/encodings.cxx "$(INTDIR_STATICRELEASE)\errorhandler.obj": src/errorhandler.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/errorhandler.cxx "$(INTDIR_STATICDEBUG)\errorhandler.obj": src/errorhandler.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/errorhandler.cxx "$(INTDIR_STATICRELEASE)\except.obj": src/except.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/except.cxx "$(INTDIR_STATICDEBUG)\except.obj": src/except.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/except.cxx "$(INTDIR_STATICRELEASE)\field.obj": src/field.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/field.cxx "$(INTDIR_STATICDEBUG)\field.obj": src/field.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/field.cxx "$(INTDIR_STATICRELEASE)\largeobject.obj": src/largeobject.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/largeobject.cxx "$(INTDIR_STATICDEBUG)\largeobject.obj": src/largeobject.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/largeobject.cxx "$(INTDIR_STATICRELEASE)\nontransaction.obj": src/nontransaction.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/nontransaction.cxx "$(INTDIR_STATICDEBUG)\nontransaction.obj": src/nontransaction.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/nontransaction.cxx "$(INTDIR_STATICRELEASE)\notification.obj": src/notification.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/notification.cxx "$(INTDIR_STATICDEBUG)\notification.obj": src/notification.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/notification.cxx "$(INTDIR_STATICRELEASE)\pipeline.obj": src/pipeline.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/pipeline.cxx "$(INTDIR_STATICDEBUG)\pipeline.obj": src/pipeline.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/pipeline.cxx "$(INTDIR_STATICRELEASE)\prepared_statement.obj": src/prepared_statement.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/prepared_statement.cxx "$(INTDIR_STATICDEBUG)\prepared_statement.obj": src/prepared_statement.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/prepared_statement.cxx "$(INTDIR_STATICRELEASE)\result.obj": src/result.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/result.cxx "$(INTDIR_STATICDEBUG)\result.obj": src/result.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/result.cxx "$(INTDIR_STATICRELEASE)\robusttransaction.obj": src/robusttransaction.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/robusttransaction.cxx "$(INTDIR_STATICDEBUG)\robusttransaction.obj": src/robusttransaction.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/robusttransaction.cxx "$(INTDIR_STATICRELEASE)\row.obj": src/row.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/row.cxx "$(INTDIR_STATICDEBUG)\row.obj": src/row.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/row.cxx "$(INTDIR_STATICRELEASE)\sql_cursor.obj": src/sql_cursor.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/sql_cursor.cxx "$(INTDIR_STATICDEBUG)\sql_cursor.obj": src/sql_cursor.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/sql_cursor.cxx "$(INTDIR_STATICRELEASE)\statement_parameters.obj": src/statement_parameters.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/statement_parameters.cxx "$(INTDIR_STATICDEBUG)\statement_parameters.obj": src/statement_parameters.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/statement_parameters.cxx "$(INTDIR_STATICRELEASE)\strconv.obj": src/strconv.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/strconv.cxx "$(INTDIR_STATICDEBUG)\strconv.obj": src/strconv.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/strconv.cxx "$(INTDIR_STATICRELEASE)\stream_base.obj": src/stream_base.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/stream_base.cxx "$(INTDIR_STATICDEBUG)\stream_base.obj": src/stream_base.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/stream_base.cxx "$(INTDIR_STATICRELEASE)\stream_from.obj": src/stream_from.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/stream_from.cxx "$(INTDIR_STATICDEBUG)\stream_from.obj": src/stream_from.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/stream_from.cxx "$(INTDIR_STATICRELEASE)\stream_to.obj": src/stream_to.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/stream_to.cxx "$(INTDIR_STATICDEBUG)\stream_to.obj": src/stream_to.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/stream_to.cxx "$(INTDIR_STATICRELEASE)\subtransaction.obj": src/subtransaction.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/subtransaction.cxx "$(INTDIR_STATICDEBUG)\subtransaction.obj": src/subtransaction.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/subtransaction.cxx "$(INTDIR_STATICRELEASE)\tablereader.obj": src/tablereader.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/tablereader.cxx "$(INTDIR_STATICDEBUG)\tablereader.obj": src/tablereader.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/tablereader.cxx "$(INTDIR_STATICRELEASE)\tablestream.obj": src/tablestream.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/tablestream.cxx "$(INTDIR_STATICDEBUG)\tablestream.obj": src/tablestream.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/tablestream.cxx "$(INTDIR_STATICRELEASE)\tablewriter.obj": src/tablewriter.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/tablewriter.cxx "$(INTDIR_STATICDEBUG)\tablewriter.obj": src/tablewriter.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/tablewriter.cxx "$(INTDIR_STATICRELEASE)\transaction.obj": src/transaction.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/transaction.cxx "$(INTDIR_STATICDEBUG)\transaction.obj": src/transaction.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/transaction.cxx "$(INTDIR_STATICRELEASE)\transaction_base.obj": src/transaction_base.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/transaction_base.cxx "$(INTDIR_STATICDEBUG)\transaction_base.obj": src/transaction_base.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/transaction_base.cxx "$(INTDIR_STATICRELEASE)\util.obj": src/util.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/util.cxx "$(INTDIR_STATICDEBUG)\util.obj": src/util.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/util.cxx "$(INTDIR_STATICRELEASE)\version.obj": src/version.cxx $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" src/version.cxx "$(INTDIR_STATICDEBUG)\version.obj": src/version.cxx $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" src/version.cxx "$(INTDIR_DLLRELEASE)\array.obj": src/array.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/array.cxx "$(INTDIR_DLLDEBUG)\array.obj": src/array.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/array.cxx "$(INTDIR_DLLRELEASE)\binarystring.obj": src/binarystring.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/binarystring.cxx "$(INTDIR_DLLDEBUG)\binarystring.obj": src/binarystring.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/binarystring.cxx "$(INTDIR_DLLRELEASE)\connection.obj": src/connection.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/connection.cxx "$(INTDIR_DLLDEBUG)\connection.obj": src/connection.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/connection.cxx "$(INTDIR_DLLRELEASE)\connection_base.obj": src/connection_base.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/connection_base.cxx "$(INTDIR_DLLDEBUG)\connection_base.obj": src/connection_base.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/connection_base.cxx "$(INTDIR_DLLRELEASE)\cursor.obj": src/cursor.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/cursor.cxx "$(INTDIR_DLLDEBUG)\cursor.obj": src/cursor.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/cursor.cxx "$(INTDIR_DLLRELEASE)\dbtransaction.obj": src/dbtransaction.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/dbtransaction.cxx "$(INTDIR_DLLDEBUG)\dbtransaction.obj": src/dbtransaction.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/dbtransaction.cxx "$(INTDIR_DLLRELEASE)\encodings.obj": src/encodings.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/encodings.cxx "$(INTDIR_DLLDEBUG)\encodings.obj": src/encodings.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/encodings.cxx "$(INTDIR_DLLRELEASE)\errorhandler.obj": src/errorhandler.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/errorhandler.cxx "$(INTDIR_DLLDEBUG)\errorhandler.obj": src/errorhandler.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/errorhandler.cxx "$(INTDIR_DLLRELEASE)\except.obj": src/except.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/except.cxx "$(INTDIR_DLLDEBUG)\except.obj": src/except.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/except.cxx "$(INTDIR_DLLRELEASE)\field.obj": src/field.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/field.cxx "$(INTDIR_DLLDEBUG)\field.obj": src/field.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/field.cxx "$(INTDIR_DLLRELEASE)\largeobject.obj": src/largeobject.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/largeobject.cxx "$(INTDIR_DLLDEBUG)\largeobject.obj": src/largeobject.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/largeobject.cxx "$(INTDIR_DLLRELEASE)\nontransaction.obj": src/nontransaction.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/nontransaction.cxx "$(INTDIR_DLLDEBUG)\nontransaction.obj": src/nontransaction.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/nontransaction.cxx "$(INTDIR_DLLRELEASE)\notification.obj": src/notification.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/notification.cxx "$(INTDIR_DLLDEBUG)\notification.obj": src/notification.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/notification.cxx "$(INTDIR_DLLRELEASE)\pipeline.obj": src/pipeline.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/pipeline.cxx "$(INTDIR_DLLDEBUG)\pipeline.obj": src/pipeline.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/pipeline.cxx "$(INTDIR_DLLRELEASE)\prepared_statement.obj": src/prepared_statement.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/prepared_statement.cxx "$(INTDIR_DLLDEBUG)\prepared_statement.obj": src/prepared_statement.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/prepared_statement.cxx "$(INTDIR_DLLRELEASE)\result.obj": src/result.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/result.cxx "$(INTDIR_DLLDEBUG)\result.obj": src/result.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/result.cxx "$(INTDIR_DLLRELEASE)\robusttransaction.obj": src/robusttransaction.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/robusttransaction.cxx "$(INTDIR_DLLDEBUG)\robusttransaction.obj": src/robusttransaction.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/robusttransaction.cxx "$(INTDIR_DLLRELEASE)\row.obj": src/row.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/row.cxx "$(INTDIR_DLLDEBUG)\row.obj": src/row.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/row.cxx "$(INTDIR_DLLRELEASE)\sql_cursor.obj": src/sql_cursor.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/sql_cursor.cxx "$(INTDIR_DLLDEBUG)\sql_cursor.obj": src/sql_cursor.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/sql_cursor.cxx "$(INTDIR_DLLRELEASE)\statement_parameters.obj": src/statement_parameters.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/statement_parameters.cxx "$(INTDIR_DLLDEBUG)\statement_parameters.obj": src/statement_parameters.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/statement_parameters.cxx "$(INTDIR_DLLRELEASE)\strconv.obj": src/strconv.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/strconv.cxx "$(INTDIR_DLLDEBUG)\strconv.obj": src/strconv.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/strconv.cxx "$(INTDIR_DLLRELEASE)\stream_base.obj": src/stream_base.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/stream_base.cxx "$(INTDIR_DLLDEBUG)\stream_base.obj": src/stream_base.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/stream_base.cxx "$(INTDIR_DLLRELEASE)\stream_from.obj": src/stream_from.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/stream_from.cxx "$(INTDIR_DLLDEBUG)\stream_from.obj": src/stream_from.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/stream_from.cxx "$(INTDIR_DLLRELEASE)\stream_to.obj": src/stream_to.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/stream_to.cxx "$(INTDIR_DLLDEBUG)\stream_to.obj": src/stream_to.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/stream_to.cxx "$(INTDIR_DLLRELEASE)\subtransaction.obj": src/subtransaction.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/subtransaction.cxx "$(INTDIR_DLLDEBUG)\subtransaction.obj": src/subtransaction.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/subtransaction.cxx "$(INTDIR_DLLRELEASE)\tablereader.obj": src/tablereader.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/tablereader.cxx "$(INTDIR_DLLDEBUG)\tablereader.obj": src/tablereader.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/tablereader.cxx "$(INTDIR_DLLRELEASE)\tablestream.obj": src/tablestream.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/tablestream.cxx "$(INTDIR_DLLDEBUG)\tablestream.obj": src/tablestream.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/tablestream.cxx "$(INTDIR_DLLRELEASE)\tablewriter.obj": src/tablewriter.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/tablewriter.cxx "$(INTDIR_DLLDEBUG)\tablewriter.obj": src/tablewriter.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/tablewriter.cxx "$(INTDIR_DLLRELEASE)\transaction.obj": src/transaction.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/transaction.cxx "$(INTDIR_DLLDEBUG)\transaction.obj": src/transaction.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/transaction.cxx "$(INTDIR_DLLRELEASE)\transaction_base.obj": src/transaction_base.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/transaction_base.cxx "$(INTDIR_DLLDEBUG)\transaction_base.obj": src/transaction_base.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/transaction_base.cxx "$(INTDIR_DLLRELEASE)\util.obj": src/util.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/util.cxx "$(INTDIR_DLLDEBUG)\util.obj": src/util.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/util.cxx "$(INTDIR_DLLRELEASE)\version.obj": src/version.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" src/version.cxx "$(INTDIR_DLLDEBUG)\version.obj": src/version.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" src/version.cxx "$(INTDIR_DLLRELEASE)\libpqxx.obj": win32/libpqxx.cxx $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" win32/libpqxx.cxx "$(INTDIR_DLLDEBUG)\libpqxx.obj": win32/libpqxx.cxx $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" win32/libpqxx.cxx libpqxx-6.4.5/win32/vc-libpqxx.mak.template000066400000000000000000000163121350065432700205700ustar00rootroot00000000000000# Visual C++ makefile for libpqxx # This file was created by Bart Samwel. default: @echo LIBPQXX Makefile for Visual C++ Available Targets @echo ------------------------------------------------- @echo. @echo Static library targets: @echo. @echo STATIC @echo STATICRELEASE (release mode only) @echo STATICDEBUG (debug mode only) @echo. @echo Dynamic Link Library (DLL) targets: @echo. @echo DLL @echo DLLRELEASE @echo DLLDEBUG @echo. @echo Other targets: @echo. @echo ALL: build both the DLL and STATIC builds. @echo CLEAN: clean up all output. @echo. @echo It is recommended that you link to libpqxx statically. Therefore, you should @echo normally build the "STATIC" target. If you want to link your programto libpqxx @echo dynamically, build target "DLL" and compile your program with preprocessor @echo define "PQXX_SHARED". This will make your program link against the DLL version @echo of libpqxx. !IF "$(OS)" == "Windows_NT" NULL= !ELSE NULL=nul !ENDIF !include win32/common ######################################################## # Configuration ######################################################## # Output DLL/LIB files. No extensions, they are added automatically! OUTDIR=lib OUTFILE_STATICDEBUG=$(OUTDIR)\libpqxx_staticD OUTFILE_STATICRELEASE=$(OUTDIR)\libpqxx_static OUTFILE_DLLDEBUG=$(OUTDIR)\libpqxxD OUTFILE_DLLRELEASE=$(OUTDIR)\libpqxx # Directories for intermediate output. INTDIR_STATICDEBUG=ObjStaticDebug INTDIR_STATICRELEASE=ObjStaticRelease INTDIR_DLLDEBUG=ObjDllDebug INTDIR_DLLRELEASE=ObjDllRelease # C++ compiler, linker (for DLLs) and library tool (for static builds). CXX=cl.exe LINK=link.exe LIBTOOL=link.exe -lib # The options common to all the different builds. CXX_FLAGS_BASE=/nologo /W3 /EHsc /FD /GR /c \ /I "include" /I $(PGSQLINC) /I $(LIBPQINC) \ /D "WIN32" /D "_MBCS" /D "_WINDOWS" /D "PQXX_INTERNAL" /D "NOMINMAX" CXX_FLAGS_DLLRELEASE=$(CXX_FLAGS_BASE) /MD /D "NDEBUG" /D "PQXX_SHARED" CXX_FLAGS_DLLDEBUG=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_DEBUG" /D "PQXX_SHARED" /RTC1 CXX_FLAGS_STATICRELEASE=$(CXX_FLAGS_BASE) /MD /D "_LIB" /D "NDEBUG" CXX_FLAGS_STATICDEBUG=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_LIB" /D "_DEBUG" /RTC1 LINK_FLAGS_BASE=kernel32.lib ws2_32.lib advapi32.lib /nologo /dll shell32.lib secur32.lib wldap32.lib LINK_FLAGS_DLLRELEASE=$(LINK_FLAGS_BASE) /libpath:$(LIBPQPATH) $(LIBPQLIB) LINK_FLAGS_DLLDEBUG=$(LINK_FLAGS_BASE) /libpath:$(LIBPQDPATH) $(LIBPQDLIB) /debug LIB_FLAGS=/nologo ######################################################## # List of intermediate files ######################################################## OBJ_STATICDEBUG=\ ###MAKTEMPLATE:FOREACH src/*.cxx "$(INTDIR_STATICDEBUG)\###BASENAME###.obj" \ ###MAKTEMPLATE:ENDFOREACH OBJ_STATICRELEASE=\ ###MAKTEMPLATE:FOREACH src/*.cxx "$(INTDIR_STATICRELEASE)\###BASENAME###.obj" \ ###MAKTEMPLATE:ENDFOREACH OBJ_DLLDEBUG=\ ###MAKTEMPLATE:FOREACH src/*.cxx,win32/libpqxx.cxx "$(INTDIR_DLLDEBUG)\###BASENAME###.obj" \ ###MAKTEMPLATE:ENDFOREACH OBJ_DLLRELEASE=\ ###MAKTEMPLATE:FOREACH src/*.cxx,win32/libpqxx.cxx "$(INTDIR_DLLRELEASE)\###BASENAME###.obj" \ ###MAKTEMPLATE:ENDFOREACH ######################################################## # Logical targets ######################################################## static: staticdebug staticrelease dll: dlldebug dllrelease all: static dll $(OUTDIR): -@mkdir $(OUTDIR) staticdebug: $(OUTFILE_STATICDEBUG).lib $(OUTDIR) $(OUTDIR)\$(LIBPQDDLL) $(OUTDIR)\$(LIBPQDLIB) staticrelease: $(OUTFILE_STATICRELEASE).lib $(OUTDIR) $(OUTDIR)\$(LIBPQDLL) $(OUTDIR)\$(LIBPQLIB) dlldebug: $(OUTFILE_DLLDEBUG).dll $(OUTDIR) $(OUTDIR)\$(LIBPQDDLL) dllrelease: $(OUTFILE_DLLRELEASE).dll $(OUTDIR) $(OUTDIR)\$(LIBPQDLL) clean: @echo Deleting all intermediate output files and the contents of $(OUTDIR). -@del /Q "$(INTDIR_STATICDEBUG)\*" -@del /Q "$(INTDIR_STATICRELEASE)\*" -@del /Q "$(INTDIR_DLLDEBUG)\*" -@del /Q "$(INTDIR_DLLRELEASE)\*" -@del /Q "$(OUTDIR)\*" ######################################################## # Physical targets ######################################################## $(OUTDIR)\$(LIBPQDLL):: $(OUTDIR) @echo ------------------------------------------------------------- @echo Copying $(LIBPQDLL) to $(OUTDIR). @echo. @echo IMPORTANT: you MUST copy this $(LIBPQDLL) into the directory @echo where your program's .EXE resides. The system $(LIBPQDLL) is @echo not necessarily compatible with the libpq include files that @echo you built libpqxx with. Do NOT copy this file into your @echo Windows system32 directory, that may break other programs. @echo Instead, keep it with your program and distribute it along @echo with the program. @echo ------------------------------------------------------------- copy "$(LIBPQPATH)\$(LIBPQDLL)" "$(OUTDIR)" $(OUTDIR)\$(LIBPQDDLL):: $(OUTDIR) @echo ------------------------------------------------------------- @echo Copying $(LIBPQDDLL) to $(OUTDIR). @echo. @echo IMPORTANT: you MUST copy this $(LIBPQDDLL) into the directory @echo where your program's .EXE resides, or you must make sure that @echo it is in your system PATH. @echo ------------------------------------------------------------- copy "$(LIBPQDPATH)\$(LIBPQDDLL)" "$(OUTDIR)" $(OUTDIR)\$(LIBPQLIB):: $(OUTDIR) copy "$(LIBPQPATH)\$(LIBPQLIB)" "$(OUTDIR)" $(OUTDIR)\$(LIBPQDLIB):: $(OUTDIR) copy "$(LIBPQDPATH)\$(LIBPQDLIB)" "$(OUTDIR)" $(OUTFILE_STATICDEBUG).lib:: $(OUTDIR) $(OBJ_STATICDEBUG) $(LIBTOOL) $(LIB_FLAGS) $(OBJ_STATICDEBUG) /out:"$(OUTFILE_STATICDEBUG).lib" $(OUTFILE_STATICRELEASE).lib:: $(OUTDIR) $(OBJ_STATICRELEASE) $(LIBTOOL) $(LIB_FLAGS) $(OBJ_STATICRELEASE) /out:"$(OUTFILE_STATICRELEASE).lib" $(OUTFILE_DLLDEBUG).dll:: $(OUTDIR) $(OBJ_DLLDEBUG) $(LINK) $(LINK_FLAGS_DLLDEBUG) $(OBJ_DLLDEBUG) /out:"$(OUTFILE_DLLDEBUG).dll" /implib:"$(OUTFILE_DLLDEBUG).lib" $(OUTFILE_DLLRELEASE).dll:: $(OUTDIR) $(OBJ_DLLRELEASE) $(LINK) $(LINK_FLAGS_DLLRELEASE) $(OBJ_DLLRELEASE) /out:"$(OUTFILE_DLLRELEASE).dll" /implib:"$(OUTFILE_DLLRELEASE).lib" $(INTDIR_STATICDEBUG):: -@mkdir $(INTDIR_STATICDEBUG) $(INTDIR_STATICRELEASE):: -@mkdir $(INTDIR_STATICRELEASE) $(INTDIR_DLLDEBUG):: -@mkdir $(INTDIR_DLLDEBUG) $(INTDIR_DLLRELEASE):: -@mkdir $(INTDIR_DLLRELEASE) ######################################################## # Physical intermediate files ######################################################## ###MAKTEMPLATE:FOREACH src/*.cxx "$(INTDIR_STATICRELEASE)\###BASENAME###.obj": ###FILENAME### $(INTDIR_STATICRELEASE) $(CXX) $(CXX_FLAGS_STATICRELEASE) /Fo"$(INTDIR_STATICRELEASE)\\" /Fd"$(INTDIR_STATICRELEASE)\\" ###FILENAME### "$(INTDIR_STATICDEBUG)\###BASENAME###.obj": ###FILENAME### $(INTDIR_STATICDEBUG) $(CXX) $(CXX_FLAGS_STATICDEBUG) /Fo"$(INTDIR_STATICDEBUG)\\" /Fd"$(INTDIR_STATICDEBUG)\\" ###FILENAME### ###MAKTEMPLATE:ENDFOREACH ###MAKTEMPLATE:FOREACH src/*.cxx,win32/libpqxx.cxx "$(INTDIR_DLLRELEASE)\###BASENAME###.obj": ###FILENAME### $(INTDIR_DLLRELEASE) $(CXX) $(CXX_FLAGS_DLLRELEASE) /Fo"$(INTDIR_DLLRELEASE)\\" /Fd"$(INTDIR_DLLRELEASE)\\" ###FILENAME### "$(INTDIR_DLLDEBUG)\###BASENAME###.obj": ###FILENAME### $(INTDIR_DLLDEBUG) $(CXX) $(CXX_FLAGS_DLLDEBUG) /Fo"$(INTDIR_DLLDEBUG)\\" /Fd"$(INTDIR_DLLDEBUG)\\" ###FILENAME### ###MAKTEMPLATE:ENDFOREACH libpqxx-6.4.5/win32/vc-test-unit.mak000066400000000000000000000173571350065432700172350ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './win32/vc-test-unit.mak.template'. ################################################################################ # Visual C++ Makefile for libpqxx unit tests # This file was written by Sam Kapilivsky, based on Bart Samwel's original. default: @echo LIBPQXX unit test suite Makefile for Visual C++ Available Targets @echo ----------------------------------------------------------------- @echo. @echo ALL: perform all tests @echo TEST_xxx: perform specific test xxx @echo CLEAN: clean up all output so that tests will run again. @echo. @echo Pass the option DLL=1 to link the test suite against the libpqxx DLL instead @echo of against the static libpqxx library, and pass DEBUG=1 to link against @echo the debug build of libpqxx. !include win32\common LIBDIR=lib # C++ compiler, linker CXX=cl.exe LINK=link.exe !IF "$(DLL)" == "1" PQXX_SHARED=/D "PQXX_SHARED" PQXXLIBTYPE=Dll PQXXLIBTYPESUFFIX= PQXXLIBEXT=dll !ELSE PQXXLIBTYPE=Static PQXXLIBEXT=lib PQXXLIBTYPESUFFIX=_static !ENDIF CXX_FLAGS_BASE=/nologo /W3 /EHsc /FD /GR /c \ /I "include" /I "test" /I $(PGSQLINC) /I $(LIBPQINC) \ /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NOMINMAX" $(PQXX_SHARED) LINK_FLAGS_BASE=kernel32.lib ws2_32.lib advapi32.lib /nologo /libpath:"$(LIBDIR)" !IF "$(DEBUG)" == "1" BUILDMODE=Debug DEBUGSUFFIX=D CXX_FLAGS=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_DEBUG" /RTC1 LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQDLIB) /debug LIBPQ=$(LIBPQDDLL) !ELSE BUILDMODE=Release DEBUGSUFFIX= CXX_FLAGS=$(CXX_FLAGS_BASE) /MD /D "NDEBUG" LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQLIB) LIBPQ=$(LIBPQDLL) !ENDIF INTDIR=Unit$(PQXXLIBTYPE)$(BUILDMODE) PQXXLIB=libpqxx$(PQXXLIBTYPESUFFIX)$(DEBUGSUFFIX).lib PQXX=libpqxx$(DEBUGSUFFIX).dll !IF "$(DLL)" == "1" DLLS=$(INTDIR)\$(LIBPQ) $(INTDIR)\$(PQXX) !ELSE DLLS=$(INTDIR)\$(LIBPQ) !ENDIF OBJS= \ $(INTDIR)\test_array.obj \ $(INTDIR)\test_binarystring.obj \ $(INTDIR)\test_cancel_query.obj \ $(INTDIR)\test_cursor.obj \ $(INTDIR)\test_encodings.obj \ $(INTDIR)\test_error_verbosity.obj \ $(INTDIR)\test_errorhandler.obj \ $(INTDIR)\test_escape.obj \ $(INTDIR)\test_exceptions.obj \ $(INTDIR)\test_float.obj \ $(INTDIR)\test_notification.obj \ $(INTDIR)\test_parameterized.obj \ $(INTDIR)\test_pipeline.obj \ $(INTDIR)\test_prepared_statement.obj \ $(INTDIR)\test_read_transaction.obj \ $(INTDIR)\test_result_iteration.obj \ $(INTDIR)\test_result_slicing.obj \ $(INTDIR)\test_row.obj \ $(INTDIR)\test_simultaneous_transactions.obj \ $(INTDIR)\test_sql_cursor.obj \ $(INTDIR)\test_stateless_cursor.obj \ $(INTDIR)\test_stream_from.obj \ $(INTDIR)\test_stream_to.obj \ $(INTDIR)\test_string_conversion.obj \ $(INTDIR)\test_subtransaction.obj \ $(INTDIR)\test_test_helpers.obj \ $(INTDIR)\test_thread_safety_model.obj \ $(INTDIR)\test_transaction_base.obj \ $(INTDIR)\test_transactor.obj \ $(INTDIR)\runner.obj ######################################################## # Logical targets ######################################################## all: runner runner: $(INTDIR) $(INTDIR)\runner.exe clean: -@del /Q $(INTDIR)\*.* $(INTDIR): @mkdir $(INTDIR) ######################################################## # Test implementations ######################################################## $(INTDIR)\runner.success: $(INTDIR)\runner.exe @$(INTDIR)\runner.exe @echo >$(INTDIR)\runner.success $(INTDIR)\runner.exe: $(OBJS) $(DLLS) @$(LINK) $(LINK_FLAGS) $(OBJS) $(PQXXLIB) /out:"$(INTDIR)\\runner.exe" $(INTDIR)\runner.obj: @$(CXX) $(CXX_FLAGS) test/unit/runner.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_array.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_array.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_binarystring.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_binarystring.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_cancel_query.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_cancel_query.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_cursor.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_cursor.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_encodings.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_encodings.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_error_verbosity.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_error_verbosity.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_errorhandler.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_errorhandler.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_escape.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_escape.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_exceptions.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_exceptions.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_float.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_float.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_notification.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_notification.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_parameterized.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_parameterized.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_pipeline.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_pipeline.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_prepared_statement.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_prepared_statement.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_read_transaction.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_read_transaction.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_result_iteration.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_result_iteration.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_result_slicing.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_result_slicing.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_row.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_row.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_simultaneous_transactions.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_simultaneous_transactions.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_sql_cursor.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_sql_cursor.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_stateless_cursor.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_stateless_cursor.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_stream_from.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_stream_from.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_stream_to.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_stream_to.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_string_conversion.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_string_conversion.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_subtransaction.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_subtransaction.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_test_helpers.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_test_helpers.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_thread_safety_model.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_thread_safety_model.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_transaction_base.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_transaction_base.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test_transactor.obj: @$(CXX) $(CXX_FLAGS) test/unit/test_transactor.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\$(LIBPQ): @copy $(LIBDIR)\$(LIBPQ) $(INTDIR) $(INTDIR)\$(PQXX): @copy $(LIBDIR)\$(PQXX) $(INTDIR) libpqxx-6.4.5/win32/vc-test-unit.mak.template000066400000000000000000000052631350065432700210400ustar00rootroot00000000000000# Visual C++ Makefile for libpqxx unit tests # This file was written by Sam Kapilivsky, based on Bart Samwel's original. default: @echo LIBPQXX unit test suite Makefile for Visual C++ Available Targets @echo ----------------------------------------------------------------- @echo. @echo ALL: perform all tests @echo TEST_xxx: perform specific test xxx @echo CLEAN: clean up all output so that tests will run again. @echo. @echo Pass the option DLL=1 to link the test suite against the libpqxx DLL instead @echo of against the static libpqxx library, and pass DEBUG=1 to link against @echo the debug build of libpqxx. !include win32\common LIBDIR=lib # C++ compiler, linker CXX=cl.exe LINK=link.exe !IF "$(DLL)" == "1" PQXX_SHARED=/D "PQXX_SHARED" PQXXLIBTYPE=Dll PQXXLIBTYPESUFFIX= PQXXLIBEXT=dll !ELSE PQXXLIBTYPE=Static PQXXLIBEXT=lib PQXXLIBTYPESUFFIX=_static !ENDIF CXX_FLAGS_BASE=/nologo /W3 /EHsc /FD /GR /c \ /I "include" /I "test" /I $(PGSQLINC) /I $(LIBPQINC) \ /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NOMINMAX" $(PQXX_SHARED) LINK_FLAGS_BASE=kernel32.lib ws2_32.lib advapi32.lib /nologo /libpath:"$(LIBDIR)" !IF "$(DEBUG)" == "1" BUILDMODE=Debug DEBUGSUFFIX=D CXX_FLAGS=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_DEBUG" /RTC1 LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQDLIB) /debug LIBPQ=$(LIBPQDDLL) !ELSE BUILDMODE=Release DEBUGSUFFIX= CXX_FLAGS=$(CXX_FLAGS_BASE) /MD /D "NDEBUG" LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQLIB) LIBPQ=$(LIBPQDLL) !ENDIF INTDIR=Unit$(PQXXLIBTYPE)$(BUILDMODE) PQXXLIB=libpqxx$(PQXXLIBTYPESUFFIX)$(DEBUGSUFFIX).lib PQXX=libpqxx$(DEBUGSUFFIX).dll !IF "$(DLL)" == "1" DLLS=$(INTDIR)\$(LIBPQ) $(INTDIR)\$(PQXX) !ELSE DLLS=$(INTDIR)\$(LIBPQ) !ENDIF OBJS= \ ###MAKTEMPLATE:FOREACH test/unit/test*.cxx $(INTDIR)\###BASENAME###.obj \ ###MAKTEMPLATE:ENDFOREACH $(INTDIR)\runner.obj ######################################################## # Logical targets ######################################################## all: runner runner: $(INTDIR) $(INTDIR)\runner.exe clean: -@del /Q $(INTDIR)\*.* $(INTDIR): @mkdir $(INTDIR) ######################################################## # Test implementations ######################################################## $(INTDIR)\runner.success: $(INTDIR)\runner.exe @$(INTDIR)\runner.exe @echo >$(INTDIR)\runner.success $(INTDIR)\runner.exe: $(OBJS) $(DLLS) @$(LINK) $(LINK_FLAGS) $(OBJS) $(PQXXLIB) /out:"$(INTDIR)\\runner.exe" ###MAKTEMPLATE:FOREACH test/unit/*.cxx $(INTDIR)\###BASENAME###.obj: @$(CXX) $(CXX_FLAGS) ###FILENAME### /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" ###MAKTEMPLATE:ENDFOREACH $(INTDIR)\$(LIBPQ): @copy $(LIBDIR)\$(LIBPQ) $(INTDIR) $(INTDIR)\$(PQXX): @copy $(LIBDIR)\$(PQXX) $(INTDIR) libpqxx-6.4.5/win32/vc-test.mak000066400000000000000000000266211350065432700162520ustar00rootroot00000000000000################################################################################ # AUTOMATICALLY GENERATED FILE -- DO NOT EDIT. # # This file is generated automatically by libpqxx's template2mak.py script, and # will be rewritten from time to time. # # If you modify this file, chances are your modifications will be lost. # # The template2mak.py script should be available in the tools directory of the # libpqxx source archive. # # Generated from template './win32/vc-test.mak.template'. ################################################################################ # Visual C++ Makefile for libpqxx test suite # This file was written by Bart Samwel. default: @echo LIBPQXX testsuite Makefile for Visual C++ Available Targets @echo ----------------------------------------------------------- @echo. @echo ALL: perform all tests @echo TESTxxx: perform specific test xxx @echo CLEAN: clean up all output so that tests will run again. @echo. @echo Pass the option DLL=1 to link the test suite against the libpqxx DLL instead @echo of against the static libpqxx library, and pass DEBUG=1 to link against @echo the debug build of libpqxx. !include win32\common LIBDIR=lib # C++ compiler, linker CXX=cl.exe LINK=link.exe !IF "$(DLL)" == "1" PQXX_SHARED=/D "PQXX_SHARED" PQXXLIBTYPE=Dll PQXXLIBTYPESUFFIX= PQXXLIBEXT=dll !ELSE PQXXLIBTYPE=Static PQXXLIBEXT=lib PQXXLIBTYPESUFFIX=_static !ENDIF CXX_FLAGS_BASE=/nologo /W3 /EHsc /FD /GR /c \ /I "include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NOMINMAX" $(PQXX_SHARED) LINK_FLAGS_BASE=kernel32.lib ws2_32.lib advapi32.lib /nologo /libpath:"$(LIBDIR)" !IF "$(DEBUG)" == "1" BUILDMODE=Debug DEBUGSUFFIX=D CXX_FLAGS=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_DEBUG" /RTC1 LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQDLIB) /debug LIBPQ=$(LIBPQDDLL) !ELSE BUILDMODE=Release DEBUGSUFFIX= CXX_FLAGS=$(CXX_FLAGS_BASE) /MD /D "NDEBUG" LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQLIB) LIBPQ=$(LIBPQDLL) !ENDIF INTDIR=Test$(PQXXLIBTYPE)$(BUILDMODE) PQXXLIB=libpqxx$(PQXXLIBTYPESUFFIX)$(DEBUGSUFFIX).lib PQXX=libpqxx$(DEBUGSUFFIX).dll !IF "$(DLL)" == "1" DLLS=$(INTDIR)\$(LIBPQ) $(INTDIR)\$(PQXX) !ELSE DLLS=$(INTDIR)\$(LIBPQ) !ENDIF OBJS= \ $(INTDIR)\test00.obj \ $(INTDIR)\test01.obj \ $(INTDIR)\test02.obj \ $(INTDIR)\test04.obj \ $(INTDIR)\test07.obj \ $(INTDIR)\test10.obj \ $(INTDIR)\test11.obj \ $(INTDIR)\test12.obj \ $(INTDIR)\test13.obj \ $(INTDIR)\test14.obj \ $(INTDIR)\test15.obj \ $(INTDIR)\test16.obj \ $(INTDIR)\test17.obj \ $(INTDIR)\test18.obj \ $(INTDIR)\test20.obj \ $(INTDIR)\test21.obj \ $(INTDIR)\test23.obj \ $(INTDIR)\test26.obj \ $(INTDIR)\test29.obj \ $(INTDIR)\test30.obj \ $(INTDIR)\test31.obj \ $(INTDIR)\test32.obj \ $(INTDIR)\test33.obj \ $(INTDIR)\test34.obj \ $(INTDIR)\test35.obj \ $(INTDIR)\test36.obj \ $(INTDIR)\test37.obj \ $(INTDIR)\test39.obj \ $(INTDIR)\test46.obj \ $(INTDIR)\test48.obj \ $(INTDIR)\test49.obj \ $(INTDIR)\test50.obj \ $(INTDIR)\test51.obj \ $(INTDIR)\test52.obj \ $(INTDIR)\test53.obj \ $(INTDIR)\test54.obj \ $(INTDIR)\test55.obj \ $(INTDIR)\test56.obj \ $(INTDIR)\test57.obj \ $(INTDIR)\test58.obj \ $(INTDIR)\test59.obj \ $(INTDIR)\test60.obj \ $(INTDIR)\test61.obj \ $(INTDIR)\test62.obj \ $(INTDIR)\test63.obj \ $(INTDIR)\test64.obj \ $(INTDIR)\test65.obj \ $(INTDIR)\test66.obj \ $(INTDIR)\test67.obj \ $(INTDIR)\test69.obj \ $(INTDIR)\test70.obj \ $(INTDIR)\test71.obj \ $(INTDIR)\test72.obj \ $(INTDIR)\test73.obj \ $(INTDIR)\test74.obj \ $(INTDIR)\test75.obj \ $(INTDIR)\test76.obj \ $(INTDIR)\test77.obj \ $(INTDIR)\test78.obj \ $(INTDIR)\test79.obj \ $(INTDIR)\test82.obj \ $(INTDIR)\test84.obj \ $(INTDIR)\test86.obj \ $(INTDIR)\test87.obj \ $(INTDIR)\test88.obj \ $(INTDIR)\test89.obj \ $(INTDIR)\test90.obj \ $(INTDIR)\test92.obj \ $(INTDIR)\test93.obj \ $(INTDIR)\runner.obj ######################################################## # Logical targets ######################################################## all: runner runner: $(INTDIR) $(INTDIR)\runner.exe clean: -@del /Q $(INTDIR)\*.* $(INTDIR): @mkdir $(INTDIR) ######################################################## # Test implementations ######################################################## $(INTDIR)\runner.success: $(INTDIR)\runner.exe @$(INTDIR)\runner.exe @echo >$(INTDIR)\runner.success $(INTDIR)\runner.exe: $(OBJS) $(DLLS) @$(LINK) $(LINK_FLAGS) $(OBJS) $(PQXXLIB) \ /out:"$(INTDIR)\\runner.exe" $(INTDIR)\runner.obj:: @$(CXX) $(CXX_FLAGS) test/runner.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test00.obj:: @$(CXX) $(CXX_FLAGS) test/test00.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test01.obj:: @$(CXX) $(CXX_FLAGS) test/test01.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test02.obj:: @$(CXX) $(CXX_FLAGS) test/test02.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test04.obj:: @$(CXX) $(CXX_FLAGS) test/test04.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test07.obj:: @$(CXX) $(CXX_FLAGS) test/test07.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test10.obj:: @$(CXX) $(CXX_FLAGS) test/test10.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test11.obj:: @$(CXX) $(CXX_FLAGS) test/test11.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test12.obj:: @$(CXX) $(CXX_FLAGS) test/test12.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test13.obj:: @$(CXX) $(CXX_FLAGS) test/test13.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test14.obj:: @$(CXX) $(CXX_FLAGS) test/test14.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test15.obj:: @$(CXX) $(CXX_FLAGS) test/test15.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test16.obj:: @$(CXX) $(CXX_FLAGS) test/test16.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test17.obj:: @$(CXX) $(CXX_FLAGS) test/test17.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test18.obj:: @$(CXX) $(CXX_FLAGS) test/test18.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test20.obj:: @$(CXX) $(CXX_FLAGS) test/test20.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test21.obj:: @$(CXX) $(CXX_FLAGS) test/test21.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test23.obj:: @$(CXX) $(CXX_FLAGS) test/test23.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test26.obj:: @$(CXX) $(CXX_FLAGS) test/test26.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test29.obj:: @$(CXX) $(CXX_FLAGS) test/test29.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test30.obj:: @$(CXX) $(CXX_FLAGS) test/test30.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test31.obj:: @$(CXX) $(CXX_FLAGS) test/test31.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test32.obj:: @$(CXX) $(CXX_FLAGS) test/test32.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test33.obj:: @$(CXX) $(CXX_FLAGS) test/test33.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test34.obj:: @$(CXX) $(CXX_FLAGS) test/test34.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test35.obj:: @$(CXX) $(CXX_FLAGS) test/test35.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test36.obj:: @$(CXX) $(CXX_FLAGS) test/test36.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test37.obj:: @$(CXX) $(CXX_FLAGS) test/test37.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test39.obj:: @$(CXX) $(CXX_FLAGS) test/test39.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test46.obj:: @$(CXX) $(CXX_FLAGS) test/test46.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test48.obj:: @$(CXX) $(CXX_FLAGS) test/test48.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test49.obj:: @$(CXX) $(CXX_FLAGS) test/test49.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test50.obj:: @$(CXX) $(CXX_FLAGS) test/test50.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test51.obj:: @$(CXX) $(CXX_FLAGS) test/test51.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test52.obj:: @$(CXX) $(CXX_FLAGS) test/test52.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test53.obj:: @$(CXX) $(CXX_FLAGS) test/test53.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test54.obj:: @$(CXX) $(CXX_FLAGS) test/test54.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test55.obj:: @$(CXX) $(CXX_FLAGS) test/test55.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test56.obj:: @$(CXX) $(CXX_FLAGS) test/test56.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test57.obj:: @$(CXX) $(CXX_FLAGS) test/test57.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test58.obj:: @$(CXX) $(CXX_FLAGS) test/test58.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test59.obj:: @$(CXX) $(CXX_FLAGS) test/test59.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test60.obj:: @$(CXX) $(CXX_FLAGS) test/test60.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test61.obj:: @$(CXX) $(CXX_FLAGS) test/test61.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test62.obj:: @$(CXX) $(CXX_FLAGS) test/test62.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test63.obj:: @$(CXX) $(CXX_FLAGS) test/test63.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test64.obj:: @$(CXX) $(CXX_FLAGS) test/test64.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test65.obj:: @$(CXX) $(CXX_FLAGS) test/test65.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test66.obj:: @$(CXX) $(CXX_FLAGS) test/test66.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test67.obj:: @$(CXX) $(CXX_FLAGS) test/test67.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test69.obj:: @$(CXX) $(CXX_FLAGS) test/test69.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test70.obj:: @$(CXX) $(CXX_FLAGS) test/test70.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test71.obj:: @$(CXX) $(CXX_FLAGS) test/test71.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test72.obj:: @$(CXX) $(CXX_FLAGS) test/test72.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test73.obj:: @$(CXX) $(CXX_FLAGS) test/test73.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test74.obj:: @$(CXX) $(CXX_FLAGS) test/test74.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test75.obj:: @$(CXX) $(CXX_FLAGS) test/test75.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test76.obj:: @$(CXX) $(CXX_FLAGS) test/test76.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test77.obj:: @$(CXX) $(CXX_FLAGS) test/test77.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test78.obj:: @$(CXX) $(CXX_FLAGS) test/test78.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test79.obj:: @$(CXX) $(CXX_FLAGS) test/test79.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test82.obj:: @$(CXX) $(CXX_FLAGS) test/test82.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test84.obj:: @$(CXX) $(CXX_FLAGS) test/test84.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test86.obj:: @$(CXX) $(CXX_FLAGS) test/test86.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test87.obj:: @$(CXX) $(CXX_FLAGS) test/test87.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test88.obj:: @$(CXX) $(CXX_FLAGS) test/test88.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test89.obj:: @$(CXX) $(CXX_FLAGS) test/test89.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test90.obj:: @$(CXX) $(CXX_FLAGS) test/test90.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test92.obj:: @$(CXX) $(CXX_FLAGS) test/test92.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\test93.obj:: @$(CXX) $(CXX_FLAGS) test/test93.cxx /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" $(INTDIR)\$(LIBPQ):: @copy "$(LIBDIR)\$(LIBPQ)" "$(INTDIR)" $(INTDIR)\$(PQXX):: @copy "$(LIBDIR)\$(PQXX)" "$(INTDIR)" libpqxx-6.4.5/win32/vc-test.mak.template000066400000000000000000000051301350065432700200540ustar00rootroot00000000000000# Visual C++ Makefile for libpqxx test suite # This file was written by Bart Samwel. default: @echo LIBPQXX testsuite Makefile for Visual C++ Available Targets @echo ----------------------------------------------------------- @echo. @echo ALL: perform all tests @echo TESTxxx: perform specific test xxx @echo CLEAN: clean up all output so that tests will run again. @echo. @echo Pass the option DLL=1 to link the test suite against the libpqxx DLL instead @echo of against the static libpqxx library, and pass DEBUG=1 to link against @echo the debug build of libpqxx. !include win32\common LIBDIR=lib # C++ compiler, linker CXX=cl.exe LINK=link.exe !IF "$(DLL)" == "1" PQXX_SHARED=/D "PQXX_SHARED" PQXXLIBTYPE=Dll PQXXLIBTYPESUFFIX= PQXXLIBEXT=dll !ELSE PQXXLIBTYPE=Static PQXXLIBEXT=lib PQXXLIBTYPESUFFIX=_static !ENDIF CXX_FLAGS_BASE=/nologo /W3 /EHsc /FD /GR /c \ /I "include" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "NOMINMAX" $(PQXX_SHARED) LINK_FLAGS_BASE=kernel32.lib ws2_32.lib advapi32.lib /nologo /libpath:"$(LIBDIR)" !IF "$(DEBUG)" == "1" BUILDMODE=Debug DEBUGSUFFIX=D CXX_FLAGS=$(CXX_FLAGS_BASE) /MDd /Gm /ZI /Od /D "_DEBUG" /RTC1 LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQDLIB) /debug LIBPQ=$(LIBPQDDLL) !ELSE BUILDMODE=Release DEBUGSUFFIX= CXX_FLAGS=$(CXX_FLAGS_BASE) /MD /D "NDEBUG" LINK_FLAGS=$(LINK_FLAGS_BASE) $(LIBPQLIB) LIBPQ=$(LIBPQDLL) !ENDIF INTDIR=Test$(PQXXLIBTYPE)$(BUILDMODE) PQXXLIB=libpqxx$(PQXXLIBTYPESUFFIX)$(DEBUGSUFFIX).lib PQXX=libpqxx$(DEBUGSUFFIX).dll !IF "$(DLL)" == "1" DLLS=$(INTDIR)\$(LIBPQ) $(INTDIR)\$(PQXX) !ELSE DLLS=$(INTDIR)\$(LIBPQ) !ENDIF OBJS= \ ###MAKTEMPLATE:FOREACH test/test*.cxx $(INTDIR)\###BASENAME###.obj \ ###MAKTEMPLATE:ENDFOREACH $(INTDIR)\runner.obj ######################################################## # Logical targets ######################################################## all: runner runner: $(INTDIR) $(INTDIR)\runner.exe clean: -@del /Q $(INTDIR)\*.* $(INTDIR): @mkdir $(INTDIR) ######################################################## # Test implementations ######################################################## $(INTDIR)\runner.success: $(INTDIR)\runner.exe @$(INTDIR)\runner.exe @echo >$(INTDIR)\runner.success $(INTDIR)\runner.exe: $(OBJS) $(DLLS) @$(LINK) $(LINK_FLAGS) $(OBJS) $(PQXXLIB) \ /out:"$(INTDIR)\\runner.exe" ###MAKTEMPLATE:FOREACH test/*.cxx $(INTDIR)\###BASENAME###.obj:: @$(CXX) $(CXX_FLAGS) ###FILENAME### /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" ###MAKTEMPLATE:ENDFOREACH $(INTDIR)\$(LIBPQ):: @copy "$(LIBDIR)\$(LIBPQ)" "$(INTDIR)" $(INTDIR)\$(PQXX):: @copy "$(LIBDIR)\$(PQXX)" "$(INTDIR)"